Demystify catopen return value in fstrace
authorRuss Allbery <rra@stanford.edu>
Wed, 15 Jul 2009 07:47:09 +0000 (00:47 -0700)
committerDerrick Brashear <shadow@dementia.org>
Thu, 16 Jul 2009 17:49:04 +0000 (11:49 -0600)
For some reason, the code was, on all platforms other than Digital
UNIX, assigning the return value of catopen to an integer, with
and then immediately assigning it to an nl_catd (the actual return
value type).  Remove all of that and store the return value directly
in an nl_catd variable.

Reviewed-on: http://gerrit.openafs.org/93
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Verified-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/venus/fstrace.c

index 48f5a7c..e77f917 100644 (file)
@@ -561,11 +561,6 @@ dce1_error_inq_text(afs_uint32 status_to_convert,
     char filename_prefix[7];
     char nls_filename[80];
     char *message;
-#if defined(AFS_64BITPOINTER_ENV)
-    long J;
-#else
-    int J;
-#endif
     static char *facility_names[] = {
        "xxx",
        "afs"
@@ -630,17 +625,8 @@ dce1_error_inq_text(afs_uint32 status_to_convert,
     afs_snprintf(nls_filename, sizeof(nls_filename), "%s/C/%s.cat",
                 AFSDIR_CLIENT_DATA_DIRPATH, filename_prefix);
 
-#if defined(AFS_OSF20_ENV)
-    catd = (nl_catd) catopen(nls_filename, 0);
-#else
-#if defined(AFS_64BITPOINTER_ENV)
-    J = (long)catopen(nls_filename, 0);
-#else
-    J = (int)catopen(nls_filename, 0);
-#endif
-    catd = (nl_catd) J;
-#endif
-    if (catd == (nl_catd) - 1) {
+    catd = catopen(nls_filename, 0);
+    if (catd == (nl_catd) -1) {
        sprintf((char *)error_text, "status %08x (%s / %s)",
                status_to_convert, facility_name, component_name);
        return;