viced.c: Don't store results of reads unecessarily
[openafs.git] / src / viced / viced.c
index d107244..cb1d426 100644 (file)
@@ -75,9 +75,6 @@
 #include "host.h"
 #ifdef AFS_PTHREAD_ENV
 # include <afs/softsig.h>
-# ifdef HAVE_PTHREAD_NP_H
-#  include <pthread_np.h>
-# endif /* HAVE_PTHREAD_NP_H */
 #endif
 #if defined(AFS_SGI_ENV)
 # include "sys/schedctl.h"
@@ -419,14 +416,7 @@ setThreadId(char *s)
     /* set our 'thread-id' so that the host hold table works */
     pthread_setspecific(rx_thread_id_key,
                        (void *)(intptr_t)rx_NewThreadId());
-# if defined(HAVE_PTHREAD_SET_NAME_NP)
-    /* The "NP" stands for "non-portable" so it's only just that
-     * implementations disagree about the name of the function.
-     */
-    pthread_set_name_np(pthread_self(), s);
-# elif defined(HAVE_PTHREAD_SETNAME_NP)
-    pthread_setname_np(pthread_self(), s);
-# endif
+    afs_pthread_setname_self(s);
     ViceLog(0,
            ("Set thread id %p for '%s'\n",
             pthread_getspecific(rx_thread_id_key), s));
@@ -1664,7 +1654,7 @@ ReadSysIdFile(void)
                 errno));
        return EIO;
     }
-    if ((i = read(fd, (char *)&vsn, sizeof(vsn))) != sizeof(vsn)) {
+    if (read(fd, (char *)&vsn, sizeof(vsn)) != sizeof(vsn)) {
        ViceLog(0,
                ("%s: Read failed (%d)\n", AFSDIR_SERVER_SYSID_FILEPATH,
                 errno));
@@ -1682,9 +1672,8 @@ ReadSysIdFile(void)
                 AFSDIR_SERVER_SYSID_FILEPATH, vsn.version, SYSIDVERSION));
        return EIO;
     }
-    if ((i =
-        read(fd, (char *)&uuid,
-             sizeof(struct afsUUID))) != sizeof(struct afsUUID)) {
+    if (read(fd, (char *)&uuid, sizeof(struct afsUUID))
+           != sizeof(struct afsUUID)) {
        ViceLog(0,
                ("%s: read of uuid failed (%d)\n",
                 AFSDIR_SERVER_SYSID_FILEPATH, errno));
@@ -1692,9 +1681,7 @@ ReadSysIdFile(void)
     }
     afs_ntohuuid(&uuid);
     FS_HostUUID = uuid;
-    if ((i =
-        read(fd, (char *)&nentries,
-             sizeof(afs_int32))) != sizeof(afs_int32)) {
+    if (read(fd, (char *)&nentries, sizeof(afs_int32)) != sizeof(afs_int32)) {
        ViceLog(0,
                ("%s: Read of entries failed (%d)\n",
                 AFSDIR_SERVER_SYSID_FILEPATH, errno));