[GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
[sfrench/samba-autobuild/.git] / source / tests / fcntl_lock64.c
index b218fa9282e8043e2e0326a1021230e743b1a5ae..e5ecd88fd0444af79108cc335c382d5f27bac323 100644 (file)
 #include <sys/fcntl.h>
 #endif
 
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#endif
-
 #include <errno.h>
 
 static int sys_waitpid(pid_t pid,int *status,int options)
@@ -44,7 +40,7 @@ int main(int argc, char *argv[])
                sleep(2);
                fd = open64(DATA, O_RDONLY);
 
-               if (fd == -1) return 1;
+               if (fd == -1) exit(1);
 
                lock.l_type = F_WRLCK;
                lock.l_whence = SEEK_SET;
@@ -60,10 +56,10 @@ int main(int argc, char *argv[])
                if ((ret == -1) ||
                    (lock.l_type == F_UNLCK)) {
 /*            printf("No lock conflict\n"); */
-                       return 1;
+                       exit(1);
                } else {
 /*            printf("lock conflict\n"); */
-                       return 0;
+                       exit(0);
                }
        }
 
@@ -96,5 +92,5 @@ int main(int argc, char *argv[])
 
        unlink(DATA);
 
-       return status;
+       exit(status);
 }