Whamcloud - gitweb
b_2074
authoryoufeng <youfeng>
Fri, 20 Feb 2004 06:03:58 +0000 (06:03 +0000)
committeryoufeng <youfeng>
Fri, 20 Feb 2004 06:03:58 +0000 (06:03 +0000)
r = Adilger

 b 2074 comment 33 -- cleanup code using fstat()

lnet/utils/debug.c
lnet/utils/l_ioctl.c
lustre/portals/utils/debug.c
lustre/portals/utils/l_ioctl.c

index 14750d8..2ca4dc3 100644 (file)
@@ -23,6 +23,8 @@
  *
  */
 
+#define __USE_FILE_OFFSET64
+
 #include <stdio.h>
 #include <netdb.h>
 #include <stdlib.h>
@@ -416,16 +418,7 @@ int jt_dbg_debug_file(int argc, char **argv)
                 return -1;
         }
 
-#ifndef __CYGWIN__
-# ifndef SYS_fstat64
-#  define __SYS_fstat__ SYS_fstat
-# else
-#  define __SYS_fstat__ SYS_fstat64
-# endif
-        rc = syscall(__SYS_fstat__, fd, &statbuf);
-#else
         rc = fstat(fd, &statbuf);
-#endif
         if (rc < 0) {
                 fprintf(stderr, "fstat failed: %s\n", strerror(errno));
                 goto out;
index 58a408a..1adcc8e 100644 (file)
@@ -20,6 +20,8 @@
  *
  */
 
+#define __USE_FILE_OFFSET64
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -244,12 +246,7 @@ parse_dump(char * dump_file, int (*ioc_func)(int dev_id, int opc, void *))
                 exit(1);
         }
 
-#ifndef SYS_fstat64
-# define __SYS_fstat__ SYS_fstat
-#else
-# define __SYS_fstat__ SYS_fstat64
-#endif
-       if (syscall(__SYS_fstat__, fd, &st)) { 
+       if (fstat(fd, &st)) { 
                perror("stat fails");
                exit(1);
        }
index 14750d8..2ca4dc3 100644 (file)
@@ -23,6 +23,8 @@
  *
  */
 
+#define __USE_FILE_OFFSET64
+
 #include <stdio.h>
 #include <netdb.h>
 #include <stdlib.h>
@@ -416,16 +418,7 @@ int jt_dbg_debug_file(int argc, char **argv)
                 return -1;
         }
 
-#ifndef __CYGWIN__
-# ifndef SYS_fstat64
-#  define __SYS_fstat__ SYS_fstat
-# else
-#  define __SYS_fstat__ SYS_fstat64
-# endif
-        rc = syscall(__SYS_fstat__, fd, &statbuf);
-#else
         rc = fstat(fd, &statbuf);
-#endif
         if (rc < 0) {
                 fprintf(stderr, "fstat failed: %s\n", strerror(errno));
                 goto out;
index 58a408a..1adcc8e 100644 (file)
@@ -20,6 +20,8 @@
  *
  */
 
+#define __USE_FILE_OFFSET64
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -244,12 +246,7 @@ parse_dump(char * dump_file, int (*ioc_func)(int dev_id, int opc, void *))
                 exit(1);
         }
 
-#ifndef SYS_fstat64
-# define __SYS_fstat__ SYS_fstat
-#else
-# define __SYS_fstat__ SYS_fstat64
-#endif
-       if (syscall(__SYS_fstat__, fd, &st)) { 
+       if (fstat(fd, &st)) { 
                perror("stat fails");
                exit(1);
        }