Merge branch 'master' into ltp-broom
Checkpoint work.
Conflicts:
doc/man3/tst_res.3
lib/tst_res.c
testcases/commands/ade/size/test.c
testcases/kernel/containers/pidns/pidns04.c
testcases/kernel/device-drivers/agp/kernel_space/tagp.c
testcases/kernel/device-drivers/base/tbase/tbase.c
testcases/kernel/device-drivers/dev_sim_framework/kernel_space/tmod.c
testcases/kernel/device-drivers/pci/tpci/tpci.c
testcases/kernel/device-drivers/tbio/kernel_space/tbio.c
testcases/kernel/device-drivers/usb/tusb/tusb.c
testcases/kernel/device-drivers/usb/user_usb/user_tusb.c
testcases/kernel/fs/acls/acl_file_test.c
testcases/kernel/fs/acls/acl_link_test.c
testcases/kernel/fs/doio/doio.c
testcases/kernel/fs/doio/growfiles.c
testcases/kernel/fs/doio/iogen.c
testcases/kernel/fs/inode/inode02.c
testcases/kernel/fs/mongo/mongo_compare.c
testcases/kernel/fs/stream/stream01.c
testcases/kernel/fs/stream/stream02.c
testcases/kernel/fs/stream/stream04.c
testcases/kernel/fs/stream/stream05.c
testcases/kernel/hotplug/memory_hotplug/commands.c
testcases/kernel/io/direct_io/diotest_routines.c
testcases/kernel/io/disktest/parse.c
testcases/kernel/io/ltp-aiodio/aio-stress.c
testcases/kernel/io/ltp-aiodio/aiodio_append.c
testcases/kernel/io/writetest/writetest.c
testcases/kernel/ipc/pipeio/pipeio.c
testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c
testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat02.c
testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c
testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c
testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c
testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c
testcases/kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c
testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c
testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c
testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c
testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c
testcases/kernel/mem/mtest01/mtest01.c
testcases/kernel/mem/vmtests/data_space.c
testcases/kernel/module/create_module/create_module01.c
testcases/kernel/module/create_module/create_module02.c
testcases/kernel/module/delete_module/delete_module02.c
testcases/kernel/module/delete_module/delete_module03.c
testcases/kernel/module/query_module/query_module01.c
testcases/kernel/module/query_module/query_module03.c
testcases/kernel/numa/support_numa.c
testcases/kernel/sched/process_stress/process.c
testcases/kernel/security/selinux-testsuite/tests/capable_file/selinux_lease.c
testcases/kernel/security/selinux-testsuite/tests/capable_sys/selinux_chroot.c
testcases/kernel/security/selinux-testsuite/tests/capable_sys/selinux_hostname.c
testcases/kernel/security/selinux-testsuite/tests/capable_sys/selinux_nice.c
testcases/kernel/security/selinux-testsuite/tests/capable_sys/selinux_rawio.c
testcases/kernel/security/selinux-testsuite/tests/file/selinux_fcntl.c
testcases/kernel/security/selinux-testsuite/tests/file/selinux_lock.c
testcases/kernel/security/selinux-testsuite/tests/file/selinux_mmap.c
testcases/kernel/security/selinux-testsuite/tests/file/selinux_mprotect.c
testcases/kernel/security/selinux-testsuite/tests/file/selinux_nofcntl.c
testcases/kernel/security/selinux-testsuite/tests/file/selinux_seek.c
testcases/kernel/security/selinux-testsuite/tests/file/selinux_sigiotask.c
testcases/kernel/security/selinux-testsuite/tests/ioctl/selinux_ioctl.c
testcases/kernel/security/selinux-testsuite/tests/ioctl/selinux_noioctl.c
testcases/kernel/syscalls/abort/abort01.c
testcases/kernel/syscalls/accept/accept01.c
testcases/kernel/syscalls/access/access01.c
testcases/kernel/syscalls/access/access02.c
testcases/kernel/syscalls/access/access03.c
testcases/kernel/syscalls/access/access04.c
testcases/kernel/syscalls/access/access05.c
testcases/kernel/syscalls/add_key/add_key01.c
testcases/kernel/syscalls/add_key/add_key02.c
testcases/kernel/syscalls/adjtimex/adjtimex01.c
testcases/kernel/syscalls/adjtimex/adjtimex02.c
testcases/kernel/syscalls/alarm/alarm01.c
testcases/kernel/syscalls/alarm/alarm02.c
testcases/kernel/syscalls/alarm/alarm03.c
testcases/kernel/syscalls/alarm/alarm05.c
testcases/kernel/syscalls/alarm/alarm06.c
testcases/kernel/syscalls/alarm/alarm07.c
testcases/kernel/syscalls/asyncio/asyncio02.c
testcases/kernel/syscalls/bdflush/bdflush01.c
testcases/kernel/syscalls/bind/bind01.c
testcases/kernel/syscalls/cacheflush/cacheflush01.c
testcases/kernel/syscalls/capget/capget01.c
testcases/kernel/syscalls/capget/capget02.c
testcases/kernel/syscalls/capset/capset01.c
testcases/kernel/syscalls/capset/capset02.c
testcases/kernel/syscalls/chdir/chdir01.c
testcases/kernel/syscalls/chdir/chdir02.c
testcases/kernel/syscalls/chdir/chdir03.c
testcases/kernel/syscalls/chdir/chdir04.c
testcases/kernel/syscalls/chmod/chmod01.c
testcases/kernel/syscalls/chmod/chmod03.c
testcases/kernel/syscalls/chmod/chmod04.c
testcases/kernel/syscalls/chmod/chmod05.c
testcases/kernel/syscalls/chmod/chmod06.c
testcases/kernel/syscalls/chmod/chmod07.c
testcases/kernel/syscalls/chown/chown01.c
testcases/kernel/syscalls/chown/chown02.c
testcases/kernel/syscalls/chown/chown03.c
testcases/kernel/syscalls/chown/chown04.c
testcases/kernel/syscalls/chown/chown05.c
testcases/kernel/syscalls/chroot/chroot01.c
testcases/kernel/syscalls/chroot/chroot02.c
testcases/kernel/syscalls/chroot/chroot03.c
testcases/kernel/syscalls/chroot/chroot04.c
testcases/kernel/syscalls/clock_getres/clock_getres01.c
testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep01.c
testcases/kernel/syscalls/clock_nanosleep2/clock_nanosleep2_01.c
testcases/kernel/syscalls/clone/clone01.c
testcases/kernel/syscalls/clone/clone02.c
testcases/kernel/syscalls/clone/clone03.c
testcases/kernel/syscalls/clone/clone04.c
testcases/kernel/syscalls/clone/clone05.c
testcases/kernel/syscalls/clone/clone06.c
testcases/kernel/syscalls/clone/clone07.c
testcases/kernel/syscalls/close/close01.c
testcases/kernel/syscalls/close/close02.c
testcases/kernel/syscalls/close/close08.c
testcases/kernel/syscalls/connect/connect01.c
testcases/kernel/syscalls/creat/creat01.c
testcases/kernel/syscalls/creat/creat03.c
testcases/kernel/syscalls/creat/creat04.c
testcases/kernel/syscalls/creat/creat05.c
testcases/kernel/syscalls/creat/creat06.c
testcases/kernel/syscalls/creat/creat07.c
testcases/kernel/syscalls/creat/creat09.c
testcases/kernel/syscalls/dup2/dup201.c
testcases/kernel/syscalls/dup2/dup203.c
testcases/kernel/syscalls/dup2/dup204.c
testcases/kernel/syscalls/dup3/dup3_01.c
testcases/kernel/syscalls/epoll_create1/epoll_create1_01.c
testcases/kernel/syscalls/eventfd2/eventfd2_01.c
testcases/kernel/syscalls/eventfd2/eventfd2_02.c
testcases/kernel/syscalls/execl/execl01.c
testcases/kernel/syscalls/execle/execle01.c
testcases/kernel/syscalls/execlp/execlp01.c
testcases/kernel/syscalls/execv/execv01.c
testcases/kernel/syscalls/execve/execve01.c
testcases/kernel/syscalls/execve/execve02.c
testcases/kernel/syscalls/execve/execve03.c
testcases/kernel/syscalls/execve/execve04.c
testcases/kernel/syscalls/execve/execve05.c
testcases/kernel/syscalls/execvp/execvp01.c
testcases/kernel/syscalls/exit/exit02.c
testcases/kernel/syscalls/exit_group/exit_group01.c
testcases/kernel/syscalls/faccessat/faccessat01.c
testcases/kernel/syscalls/fadvise/posix_fadvise01.c
testcases/kernel/syscalls/fadvise/posix_fadvise02.c
testcases/kernel/syscalls/fadvise/posix_fadvise03.c
testcases/kernel/syscalls/fadvise/posix_fadvise04.c
testcases/kernel/syscalls/fallocate/fallocate01.c
testcases/kernel/syscalls/fallocate/fallocate02.c
testcases/kernel/syscalls/fallocate/fallocate03.c
testcases/kernel/syscalls/fchdir/fchdir01.c
testcases/kernel/syscalls/fchdir/fchdir02.c
testcases/kernel/syscalls/fchdir/fchdir03.c
testcases/kernel/syscalls/fchmod/fchmod01.c
testcases/kernel/syscalls/fchmod/fchmod02.c
testcases/kernel/syscalls/fchmod/fchmod03.c
testcases/kernel/syscalls/fchmod/fchmod04.c
testcases/kernel/syscalls/fchmod/fchmod05.c
testcases/kernel/syscalls/fchmod/fchmod06.c
testcases/kernel/syscalls/fchmod/fchmod07.c
testcases/kernel/syscalls/fchmodat/fchmodat01.c
testcases/kernel/syscalls/fchown/fchown01.c
testcases/kernel/syscalls/fchown/fchown02.c
testcases/kernel/syscalls/fchown/fchown03.c
testcases/kernel/syscalls/fchown/fchown04.c
testcases/kernel/syscalls/fchown/fchown05.c
testcases/kernel/syscalls/fchownat/fchownat01.c
testcases/kernel/syscalls/fcntl/fcntl01.c
testcases/kernel/syscalls/fcntl/fcntl02.c
testcases/kernel/syscalls/fcntl/fcntl03.c
testcases/kernel/syscalls/fcntl/fcntl04.c
testcases/kernel/syscalls/fcntl/fcntl05.c
testcases/kernel/syscalls/fcntl/fcntl06.c
testcases/kernel/syscalls/fcntl/fcntl09.c
testcases/kernel/syscalls/fcntl/fcntl10.c
testcases/kernel/syscalls/fcntl/fcntl11.c
testcases/kernel/syscalls/fcntl/fcntl12.c
testcases/kernel/syscalls/fcntl/fcntl13.c
testcases/kernel/syscalls/fcntl/fcntl14.c
testcases/kernel/syscalls/fcntl/fcntl15.c
testcases/kernel/syscalls/fcntl/fcntl16.c
testcases/kernel/syscalls/fcntl/fcntl17.c
testcases/kernel/syscalls/fcntl/fcntl18.c
testcases/kernel/syscalls/fcntl/fcntl19.c
testcases/kernel/syscalls/fcntl/fcntl20.c
testcases/kernel/syscalls/fcntl/fcntl21.c
testcases/kernel/syscalls/fcntl/fcntl22.c
testcases/kernel/syscalls/fcntl/fcntl23.c
testcases/kernel/syscalls/fcntl/fcntl24.c
testcases/kernel/syscalls/fcntl/fcntl25.c
testcases/kernel/syscalls/fcntl/fcntl26.c
testcases/kernel/syscalls/fcntl/fcntl27.c
testcases/kernel/syscalls/fcntl/fcntl28.c
testcases/kernel/syscalls/fork/fork01.c
testcases/kernel/syscalls/fork/fork02.c
testcases/kernel/syscalls/fork/fork03.c
testcases/kernel/syscalls/fork/fork06.c
testcases/kernel/syscalls/fork/fork07.c
testcases/kernel/syscalls/fork/fork08.c
testcases/kernel/syscalls/fork/fork09.c
testcases/kernel/syscalls/fork/fork10.c
testcases/kernel/syscalls/fork/fork11.c
testcases/kernel/syscalls/fork/fork12.c
testcases/kernel/syscalls/fstat/fstat01.c
testcases/kernel/syscalls/fstat/fstat02.c
testcases/kernel/syscalls/fstat/fstat03.c
testcases/kernel/syscalls/fstat/fstat04.c
testcases/kernel/syscalls/fstat/fstat05.c
testcases/kernel/syscalls/fstatat/fstatat01.c
testcases/kernel/syscalls/fstatfs/fstatfs01.c
testcases/kernel/syscalls/fstatfs/fstatfs02.c
testcases/kernel/syscalls/fsync/fsync01.c
testcases/kernel/syscalls/fsync/fsync02.c
testcases/kernel/syscalls/fsync/fsync03.c
testcases/kernel/syscalls/ftruncate/ftruncate01.c
testcases/kernel/syscalls/ftruncate/ftruncate02.c
testcases/kernel/syscalls/futimesat/futimesat01.c
testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
testcases/kernel/syscalls/get_robust_list/get_robust_list01.c
testcases/kernel/syscalls/getcontext/getcontext01.c
testcases/kernel/syscalls/getcpu/getcpu01.c
testcases/kernel/syscalls/getcwd/getcwd01.c
testcases/kernel/syscalls/getcwd/getcwd02.c
testcases/kernel/syscalls/getcwd/getcwd03.c
testcases/kernel/syscalls/getdents/getdents01.c
testcases/kernel/syscalls/getdents/getdents02.c
testcases/kernel/syscalls/getdents/getdents03.c
testcases/kernel/syscalls/getdents/getdents04.c
testcases/kernel/syscalls/getdomainname/getdomainname01.c
testcases/kernel/syscalls/getegid/getegid01.c
testcases/kernel/syscalls/getegid/getegid02.c
testcases/kernel/syscalls/geteuid/geteuid01.c
testcases/kernel/syscalls/getgid/getgid01.c
testcases/kernel/syscalls/getgid/getgid03.c
testcases/kernel/syscalls/getgroups/getgroups02.c
testcases/kernel/syscalls/getgroups/getgroups03.c
testcases/kernel/syscalls/getgroups/getgroups04.c
testcases/kernel/syscalls/gethostid/gethostid01.c
testcases/kernel/syscalls/gethostname/gethostname01.c
testcases/kernel/syscalls/getitimer/getitimer01.c
testcases/kernel/syscalls/getitimer/getitimer02.c
testcases/kernel/syscalls/getitimer/getitimer03.c
testcases/kernel/syscalls/getpagesize/getpagesize01.c
testcases/kernel/syscalls/getpeername/getpeername01.c
testcases/kernel/syscalls/getpgid/getpgid01.c
testcases/kernel/syscalls/getpgid/getpgid02.c
testcases/kernel/syscalls/getpgrp/getpgrp01.c
testcases/kernel/syscalls/getpid/getpid01.c
testcases/kernel/syscalls/getpid/getpid02.c
testcases/kernel/syscalls/getppid/getppid01.c
testcases/kernel/syscalls/getppid/getppid02.c
testcases/kernel/syscalls/getpriority/getpriority01.c
testcases/kernel/syscalls/getpriority/getpriority02.c
testcases/kernel/syscalls/getresgid/getresgid01.c
testcases/kernel/syscalls/getresgid/getresgid02.c
testcases/kernel/syscalls/getresgid/getresgid03.c
testcases/kernel/syscalls/getresuid/getresuid01.c
testcases/kernel/syscalls/getresuid/getresuid02.c
testcases/kernel/syscalls/getresuid/getresuid03.c
testcases/kernel/syscalls/getrusage/getrusage01.c
testcases/kernel/syscalls/getrusage/getrusage02.c
testcases/kernel/syscalls/getsid/getsid01.c
testcases/kernel/syscalls/getsid/getsid02.c
testcases/kernel/syscalls/getsockname/getsockname01.c
testcases/kernel/syscalls/getsockopt/getsockopt01.c
testcases/kernel/syscalls/gettid/gettid01.c
testcases/kernel/syscalls/gettimeofday/gettimeofday01.c
testcases/kernel/syscalls/gettimeofday/gettimeofday02.c
testcases/kernel/syscalls/getuid/getuid01.c
testcases/kernel/syscalls/getuid/getuid02.c
testcases/kernel/syscalls/inotify/inotify01.c
testcases/kernel/syscalls/inotify/inotify02.c
testcases/kernel/syscalls/inotify/inotify03.c
testcases/kernel/syscalls/inotify_init/inotify_init1_01.c
testcases/kernel/syscalls/inotify_init/inotify_init1_02.c
testcases/kernel/syscalls/io_cancel/io_cancel01.c
testcases/kernel/syscalls/io_destroy/io_destroy01.c
testcases/kernel/syscalls/io_getevents/io_getevents01.c
testcases/kernel/syscalls/io_setup/io_setup01.c
testcases/kernel/syscalls/io_submit/io_submit01.c
testcases/kernel/syscalls/ioctl/ioctl01.c
testcases/kernel/syscalls/ioctl/ioctl02.c
testcases/kernel/syscalls/ioperm/ioperm01.c
testcases/kernel/syscalls/ioperm/ioperm02.c
testcases/kernel/syscalls/iopl/iopl01.c
testcases/kernel/syscalls/iopl/iopl02.c
testcases/kernel/syscalls/ipc/msgctl/msgctl01.c
testcases/kernel/syscalls/ipc/msgctl/msgctl02.c
testcases/kernel/syscalls/ipc/msgctl/msgctl03.c
testcases/kernel/syscalls/ipc/msgctl/msgctl04.c
testcases/kernel/syscalls/ipc/msgctl/msgctl05.c
testcases/kernel/syscalls/ipc/msgctl/msgctl08.c
testcases/kernel/syscalls/ipc/msgctl/msgctl09.c
testcases/kernel/syscalls/ipc/msgctl/msgctl10.c
testcases/kernel/syscalls/ipc/msgctl/msgctl11.c
testcases/kernel/syscalls/ipc/msgget/msgget01.c
testcases/kernel/syscalls/ipc/msgget/msgget02.c
testcases/kernel/syscalls/ipc/msgget/msgget03.c
testcases/kernel/syscalls/ipc/msgget/msgget04.c
testcases/kernel/syscalls/ipc/msgrcv/msgrcv01.c
testcases/kernel/syscalls/ipc/msgrcv/msgrcv02.c
testcases/kernel/syscalls/ipc/msgrcv/msgrcv03.c
testcases/kernel/syscalls/ipc/msgrcv/msgrcv04.c
testcases/kernel/syscalls/ipc/msgrcv/msgrcv05.c
testcases/kernel/syscalls/ipc/msgrcv/msgrcv06.c
testcases/kernel/syscalls/ipc/msgsnd/msgsnd01.c
testcases/kernel/syscalls/ipc/msgsnd/msgsnd02.c
testcases/kernel/syscalls/ipc/msgsnd/msgsnd03.c
testcases/kernel/syscalls/ipc/msgsnd/msgsnd04.c
testcases/kernel/syscalls/ipc/msgsnd/msgsnd05.c
testcases/kernel/syscalls/ipc/msgsnd/msgsnd06.c
testcases/kernel/syscalls/ipc/semctl/semctl01.c
testcases/kernel/syscalls/ipc/semctl/semctl02.c
testcases/kernel/syscalls/ipc/semctl/semctl03.c
testcases/kernel/syscalls/ipc/semctl/semctl04.c
testcases/kernel/syscalls/ipc/semctl/semctl05.c
testcases/kernel/syscalls/ipc/semctl/semctl06.c
testcases/kernel/syscalls/ipc/semget/semget01.c
testcases/kernel/syscalls/ipc/semget/semget02.c
testcases/kernel/syscalls/ipc/semget/semget03.c
testcases/kernel/syscalls/ipc/semget/semget05.c
testcases/kernel/syscalls/ipc/semget/semget06.c
testcases/kernel/syscalls/ipc/semop/semop01.c
testcases/kernel/syscalls/ipc/semop/semop02.c
testcases/kernel/syscalls/ipc/semop/semop03.c
testcases/kernel/syscalls/ipc/semop/semop04.c
testcases/kernel/syscalls/ipc/semop/semop05.c
testcases/kernel/syscalls/ipc/shmat/shmat01.c
testcases/kernel/syscalls/ipc/shmat/shmat02.c
testcases/kernel/syscalls/ipc/shmat/shmat03.c
testcases/kernel/syscalls/ipc/shmctl/shmctl01.c
testcases/kernel/syscalls/ipc/shmctl/shmctl02.c
testcases/kernel/syscalls/ipc/shmctl/shmctl03.c
testcases/kernel/syscalls/ipc/shmctl/shmctl04.c
testcases/kernel/syscalls/ipc/shmdt/shmdt01.c
testcases/kernel/syscalls/ipc/shmdt/shmdt02.c
testcases/kernel/syscalls/ipc/shmget/shmget01.c
testcases/kernel/syscalls/ipc/shmget/shmget02.c
testcases/kernel/syscalls/ipc/shmget/shmget03.c
testcases/kernel/syscalls/ipc/shmget/shmget04.c
testcases/kernel/syscalls/ipc/shmget/shmget05.c
testcases/kernel/syscalls/keyctl/keyctl01.c
testcases/kernel/syscalls/kill/kill01.c
testcases/kernel/syscalls/kill/kill03.c
testcases/kernel/syscalls/kill/kill04.c
testcases/kernel/syscalls/kill/kill05.c
testcases/kernel/syscalls/kill/kill06.c
testcases/kernel/syscalls/kill/kill07.c
testcases/kernel/syscalls/kill/kill08.c
testcases/kernel/syscalls/kill/kill11.c
testcases/kernel/syscalls/lchown/lchown01.c
testcases/kernel/syscalls/lchown/lchown02.c
testcases/kernel/syscalls/linkat/linkat01.c
testcases/kernel/syscalls/listen/listen01.c
testcases/kernel/syscalls/llseek/llseek01.c
testcases/kernel/syscalls/llseek/llseek02.c
testcases/kernel/syscalls/lseek/lseek06.c
testcases/kernel/syscalls/lseek/lseek07.c
testcases/kernel/syscalls/lseek/lseek08.c
testcases/kernel/syscalls/lseek/lseek09.c
testcases/kernel/syscalls/lseek/lseek10.c
testcases/kernel/syscalls/lstat/lstat01.c
testcases/kernel/syscalls/lstat/lstat02.c
testcases/kernel/syscalls/lstat/lstat03.c
testcases/kernel/syscalls/mbind/mbind01.c
testcases/kernel/syscalls/mkdir/mkdir01.c
testcases/kernel/syscalls/mkdir/mkdir02.c
testcases/kernel/syscalls/mkdir/mkdir03.c
testcases/kernel/syscalls/mkdir/mkdir04.c
testcases/kernel/syscalls/mkdir/mkdir05.c
testcases/kernel/syscalls/mkdir/mkdir08.c
testcases/kernel/syscalls/mkdirat/mkdirat01.c
testcases/kernel/syscalls/mknod/mknod02.c
testcases/kernel/syscalls/mknod/mknod03.c
testcases/kernel/syscalls/mknod/mknod04.c
testcases/kernel/syscalls/mknod/mknod05.c
testcases/kernel/syscalls/mknod/mknod06.c
testcases/kernel/syscalls/mknod/mknod07.c
testcases/kernel/syscalls/mknod/mknod08.c
testcases/kernel/syscalls/mknod/mknod09.c
testcases/kernel/syscalls/mknodat/mknodat01.c
testcases/kernel/syscalls/mmap/mmap001.c
testcases/kernel/syscalls/mmap/mmap01.c
testcases/kernel/syscalls/mmap/mmap02.c
testcases/kernel/syscalls/mmap/mmap03.c
testcases/kernel/syscalls/mmap/mmap04.c
testcases/kernel/syscalls/mmap/mmap05.c
testcases/kernel/syscalls/mmap/mmap06.c
testcases/kernel/syscalls/mmap/mmap07.c
testcases/kernel/syscalls/mmap/mmap08.c
testcases/kernel/syscalls/mmap/mmap09.c
testcases/kernel/syscalls/modify_ldt/modify_ldt01.c
testcases/kernel/syscalls/modify_ldt/modify_ldt02.c
testcases/kernel/syscalls/mount/mount01.c
testcases/kernel/syscalls/mount/mount02.c
testcases/kernel/syscalls/mount/mount03.c
testcases/kernel/syscalls/mprotect/mprotect01.c
testcases/kernel/syscalls/mprotect/mprotect02.c
testcases/kernel/syscalls/mprotect/mprotect03.c
testcases/kernel/syscalls/mq_notify/mq_notify01.c
testcases/kernel/syscalls/mq_open/mq_open01.c
testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c
testcases/kernel/syscalls/mq_timedsend/mq_timedsend01.c
testcases/kernel/syscalls/mq_unlink/mq_unlink01.c
testcases/kernel/syscalls/mremap/mremap01.c
testcases/kernel/syscalls/mremap/mremap02.c
testcases/kernel/syscalls/mremap/mremap03.c
testcases/kernel/syscalls/mremap/mremap04.c
testcases/kernel/syscalls/msync/msync01.c
testcases/kernel/syscalls/msync/msync02.c
testcases/kernel/syscalls/msync/msync03.c
testcases/kernel/syscalls/msync/msync04.c
testcases/kernel/syscalls/msync/msync05.c
testcases/kernel/syscalls/munmap/munmap01.c
testcases/kernel/syscalls/munmap/munmap02.c
testcases/kernel/syscalls/munmap/munmap03.c
testcases/kernel/syscalls/nanosleep/nanosleep01.c
testcases/kernel/syscalls/nanosleep/nanosleep02.c
testcases/kernel/syscalls/nanosleep/nanosleep03.c
testcases/kernel/syscalls/nanosleep/nanosleep04.c
testcases/kernel/syscalls/newuname/newuname01.c
testcases/kernel/syscalls/nice/nice01.c
testcases/kernel/syscalls/nice/nice02.c
testcases/kernel/syscalls/nice/nice03.c
testcases/kernel/syscalls/nice/nice04.c
testcases/kernel/syscalls/open/open01.c
testcases/kernel/syscalls/open/open02.c
testcases/kernel/syscalls/open/open03.c
testcases/kernel/syscalls/open/open04.c
testcases/kernel/syscalls/open/open05.c
testcases/kernel/syscalls/open/open06.c
testcases/kernel/syscalls/open/open07.c
testcases/kernel/syscalls/open/open08.c
testcases/kernel/syscalls/open/open10.c
testcases/kernel/syscalls/openat/openat01.c
testcases/kernel/syscalls/pathconf/pathconf01.c
testcases/kernel/syscalls/pause/pause01.c
testcases/kernel/syscalls/pause/pause02.c
testcases/kernel/syscalls/pause/pause03.c
testcases/kernel/syscalls/personality/personality01.c
testcases/kernel/syscalls/personality/personality02.c
testcases/kernel/syscalls/pipe/pipe01.c
testcases/kernel/syscalls/pipe/pipe02.c
testcases/kernel/syscalls/pipe/pipe03.c
testcases/kernel/syscalls/pipe/pipe04.c
testcases/kernel/syscalls/pipe/pipe05.c
testcases/kernel/syscalls/pipe/pipe06.c
testcases/kernel/syscalls/pipe/pipe07.c
testcases/kernel/syscalls/pipe/pipe08.c
testcases/kernel/syscalls/pipe/pipe09.c
testcases/kernel/syscalls/pipe/pipe10.c
testcases/kernel/syscalls/pipe/pipe11.c
testcases/kernel/syscalls/pipe2/pipe2_01.c
testcases/kernel/syscalls/pipe2/pipe2_02.c
testcases/kernel/syscalls/poll/poll01.c
testcases/kernel/syscalls/prctl/prctl01.c
testcases/kernel/syscalls/prctl/prctl02.c
testcases/kernel/syscalls/pread/pread01.c
testcases/kernel/syscalls/pread/pread02.c
testcases/kernel/syscalls/pread/pread03.c
testcases/kernel/syscalls/ptrace/ptrace01.c
testcases/kernel/syscalls/ptrace/ptrace02.c
testcases/kernel/syscalls/ptrace/ptrace03.c
testcases/kernel/syscalls/pwrite/pwrite01.c
testcases/kernel/syscalls/pwrite/pwrite02.c
testcases/kernel/syscalls/pwrite/pwrite03.c
testcases/kernel/syscalls/read/read01.c
testcases/kernel/syscalls/read/read02.c
testcases/kernel/syscalls/read/read03.c
testcases/kernel/syscalls/read/read04.c
testcases/kernel/syscalls/readdir/readdir02.c
testcases/kernel/syscalls/readlink/readlink01.c
testcases/kernel/syscalls/readlink/readlink02.c
testcases/kernel/syscalls/readlink/readlink03.c
testcases/kernel/syscalls/readlink/readlink04.c
testcases/kernel/syscalls/readlinkat/readlinkat01.c
testcases/kernel/syscalls/readv/readv01.c
testcases/kernel/syscalls/readv/readv02.c
testcases/kernel/syscalls/readv/readv03.c
testcases/kernel/syscalls/reboot/reboot01.c
testcases/kernel/syscalls/reboot/reboot02.c
testcases/kernel/syscalls/recv/recv01.c
testcases/kernel/syscalls/recvfrom/recvfrom01.c
testcases/kernel/syscalls/recvmsg/recvmsg01.c
testcases/kernel/syscalls/remap_file_pages/remap_file_pages01.c
testcases/kernel/syscalls/remap_file_pages/remap_file_pages02.c
testcases/kernel/syscalls/rename/rename01.c
testcases/kernel/syscalls/rename/rename02.c
testcases/kernel/syscalls/rename/rename03.c
testcases/kernel/syscalls/rename/rename04.c
testcases/kernel/syscalls/rename/rename05.c
testcases/kernel/syscalls/rename/rename06.c
testcases/kernel/syscalls/rename/rename07.c
testcases/kernel/syscalls/rename/rename08.c
testcases/kernel/syscalls/rename/rename09.c
testcases/kernel/syscalls/rename/rename10.c
testcases/kernel/syscalls/rename/rename12.c
testcases/kernel/syscalls/rename/rename13.c
testcases/kernel/syscalls/rename/rename14.c
testcases/kernel/syscalls/renameat/renameat01.c
testcases/kernel/syscalls/rmdir/rmdir01.c
testcases/kernel/syscalls/rmdir/rmdir02.c
testcases/kernel/syscalls/rmdir/rmdir03.c
testcases/kernel/syscalls/rmdir/rmdir04.c
testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c
testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max01.c
testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max02.c
testcases/kernel/syscalls/sched_get_priority_min/sched_get_priority_min01.c
testcases/kernel/syscalls/sched_get_priority_min/sched_get_priority_min02.c
testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c
testcases/kernel/syscalls/sched_getparam/sched_getparam01.c
testcases/kernel/syscalls/sched_getparam/sched_getparam02.c
testcases/kernel/syscalls/sched_getparam/sched_getparam03.c
testcases/kernel/syscalls/sched_getscheduler/sched_getscheduler01.c
testcases/kernel/syscalls/sched_getscheduler/sched_getscheduler02.c
testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c
testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval02.c
testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval03.c
testcases/kernel/syscalls/sched_setparam/sched_setparam01.c
testcases/kernel/syscalls/sched_setparam/sched_setparam02.c
testcases/kernel/syscalls/sched_setparam/sched_setparam03.c
testcases/kernel/syscalls/sched_setparam/sched_setparam04.c
testcases/kernel/syscalls/sched_setparam/sched_setparam05.c
testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler01.c
testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler02.c
testcases/kernel/syscalls/sched_yield/sched_yield01.c
testcases/kernel/syscalls/send/send01.c
testcases/kernel/syscalls/sendfile/sendfile02.c
testcases/kernel/syscalls/sendfile/sendfile03.c
testcases/kernel/syscalls/sendfile/sendfile04.c
testcases/kernel/syscalls/sendfile/sendfile05.c
testcases/kernel/syscalls/sendfile/sendfile06.c
testcases/kernel/syscalls/sendfile/sendfile07.c
testcases/kernel/syscalls/sendmsg/sendmsg01.c
testcases/kernel/syscalls/sendto/sendto01.c
testcases/kernel/syscalls/set_robust_list/set_robust_list01.c
testcases/kernel/syscalls/set_thread_area/set_thread_area01.c
testcases/kernel/syscalls/set_thread_area/set_thread_area02.c
testcases/kernel/syscalls/set_tid_address/set_tid_address01.c
testcases/kernel/syscalls/setdomainname/setdomainname02.c
testcases/kernel/syscalls/setdomainname/setdomainname03.c
testcases/kernel/syscalls/setfsgid/setfsgid01.c
testcases/kernel/syscalls/setfsgid/setfsgid02.c
testcases/kernel/syscalls/setfsgid/setfsgid03.c
testcases/kernel/syscalls/setfsuid/setfsuid01.c
testcases/kernel/syscalls/setfsuid/setfsuid02.c
testcases/kernel/syscalls/setfsuid/setfsuid03.c
testcases/kernel/syscalls/setfsuid/setfsuid04.c
testcases/kernel/syscalls/setgid/setgid01.c
testcases/kernel/syscalls/setgid/setgid02.c
testcases/kernel/syscalls/setgid/setgid03.c
testcases/kernel/syscalls/setgroups/setgroups02.c
testcases/kernel/syscalls/setgroups/setgroups03.c
testcases/kernel/syscalls/setgroups/setgroups04.c
testcases/kernel/syscalls/setitimer/setitimer01.c
testcases/kernel/syscalls/setitimer/setitimer02.c
testcases/kernel/syscalls/setitimer/setitimer03.c
testcases/kernel/syscalls/setpgid/setpgid01.c
testcases/kernel/syscalls/setpgid/setpgid02.c
testcases/kernel/syscalls/setpgid/setpgid03.c
testcases/kernel/syscalls/setpgrp/setpgrp02.c
testcases/kernel/syscalls/setpriority/setpriority01.c
testcases/kernel/syscalls/setpriority/setpriority02.c
testcases/kernel/syscalls/setpriority/setpriority03.c
testcases/kernel/syscalls/setpriority/setpriority04.c
testcases/kernel/syscalls/setpriority/setpriority05.c
testcases/kernel/syscalls/setregid/setregid01.c
testcases/kernel/syscalls/setregid/setregid02.c
testcases/kernel/syscalls/setregid/setregid03.c
testcases/kernel/syscalls/setregid/setregid04.c
testcases/kernel/syscalls/setresuid/setresuid04.c
testcases/kernel/syscalls/setreuid/setreuid01.c
testcases/kernel/syscalls/setreuid/setreuid07.c
testcases/kernel/syscalls/setrlimit/setrlimit01.c
testcases/kernel/syscalls/setrlimit/setrlimit02.c
testcases/kernel/syscalls/setrlimit/setrlimit03.c
testcases/kernel/syscalls/setsid/setsid01.c
testcases/kernel/syscalls/setsockopt/setsockopt01.c
testcases/kernel/syscalls/setuid/setuid02.c
testcases/kernel/syscalls/setuid/setuid03.c
testcases/kernel/syscalls/setuid/setuid04.c
testcases/kernel/syscalls/sgetmask/sgetmask01.c
testcases/kernel/syscalls/sigaction/sigaction01.c
testcases/kernel/syscalls/sigaction/sigaction02.c
testcases/kernel/syscalls/sigaltstack/sigaltstack01.c
testcases/kernel/syscalls/sigaltstack/sigaltstack02.c
testcases/kernel/syscalls/signal/signal02.c
testcases/kernel/syscalls/signal/signal03.c
testcases/kernel/syscalls/signal/signal04.c
testcases/kernel/syscalls/signal/signal05.c
testcases/kernel/syscalls/signalfd4/signalfd4_01.c
testcases/kernel/syscalls/signalfd4/signalfd4_02.c
testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
testcases/kernel/syscalls/sigsuspend/sigsuspend01.c
testcases/kernel/syscalls/socket/socket01.c
testcases/kernel/syscalls/socket/socket02.c
testcases/kernel/syscalls/socket/socket03.c
testcases/kernel/syscalls/socketpair/socketpair01.c
testcases/kernel/syscalls/socketpair/socketpair02.c
testcases/kernel/syscalls/sockioctl/sockioctl01.c
testcases/kernel/syscalls/splice/splice02.c
testcases/kernel/syscalls/ssetmask/ssetmask01.c
testcases/kernel/syscalls/stat/stat01.c
testcases/kernel/syscalls/stat/stat02.c
testcases/kernel/syscalls/stat/stat03.c
testcases/kernel/syscalls/stat/stat05.c
testcases/kernel/syscalls/statfs/statfs01.c
testcases/kernel/syscalls/statfs/statfs02.c
testcases/kernel/syscalls/statfs/statfs03.c
testcases/kernel/syscalls/statvfs/statvfs01.c
testcases/kernel/syscalls/stime/stime01.c
testcases/kernel/syscalls/stime/stime02.c
testcases/kernel/syscalls/swapoff/swapoff01.c
testcases/kernel/syscalls/swapoff/swapoff02.c
testcases/kernel/syscalls/swapon/swapon01.c
testcases/kernel/syscalls/swapon/swapon02.c
testcases/kernel/syscalls/swapon/swapon03.c
testcases/kernel/syscalls/symlink/symlink02.c
testcases/kernel/syscalls/symlink/symlink03.c
testcases/kernel/syscalls/symlink/symlink04.c
testcases/kernel/syscalls/symlink/symlink05.c
testcases/kernel/syscalls/symlinkat/symlinkat01.c
testcases/kernel/syscalls/sync/sync01.c
testcases/kernel/syscalls/sync/sync02.c
testcases/kernel/syscalls/sync_file_range/sync_file_range01.c
testcases/kernel/syscalls/sysctl/sysctl01.c
testcases/kernel/syscalls/sysctl/sysctl04.c
testcases/kernel/syscalls/sysctl/sysctl05.c
testcases/kernel/syscalls/sysinfo/sysinfo01.c
testcases/kernel/syscalls/sysinfo/sysinfo02.c
testcases/kernel/syscalls/tee/tee01.c
testcases/kernel/syscalls/time/time01.c
testcases/kernel/syscalls/time/time02.c
testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c
testcases/kernel/syscalls/timer_gettime/timer_gettime01.c
testcases/kernel/syscalls/timerfd/timerfd02.c
testcases/kernel/syscalls/timerfd/timerfd03.c
testcases/kernel/syscalls/times/times01.c
testcases/kernel/syscalls/tkill/tkill01.c
testcases/kernel/syscalls/tkill/tkill02.c
testcases/kernel/syscalls/truncate/truncate01.c
testcases/kernel/syscalls/truncate/truncate02.c
testcases/kernel/syscalls/truncate/truncate03.c
testcases/kernel/syscalls/truncate/truncate04.c
testcases/kernel/syscalls/umask/umask01.c
testcases/kernel/syscalls/umask/umask03.c
testcases/kernel/syscalls/uname/uname01.c
testcases/kernel/syscalls/uname/uname02.c
testcases/kernel/syscalls/uname/uname03.c
testcases/kernel/syscalls/unlink/unlink05.c
testcases/kernel/syscalls/unlinkat/unlinkat01.c
testcases/kernel/syscalls/unshare/unshare01.c
testcases/kernel/syscalls/unshare/unshare02.c
testcases/kernel/syscalls/ustat/ustat01.c
testcases/kernel/syscalls/ustat/ustat02.c
testcases/kernel/syscalls/utime/utime01.c
testcases/kernel/syscalls/utime/utime02.c
testcases/kernel/syscalls/utime/utime03.c
testcases/kernel/syscalls/utime/utime04.c
testcases/kernel/syscalls/utime/utime05.c
testcases/kernel/syscalls/utime/utime06.c
testcases/kernel/syscalls/utimes/utimes01.c
testcases/kernel/syscalls/vfork/vfork01.c
testcases/kernel/syscalls/vfork/vfork02.c
testcases/kernel/syscalls/vmsplice/vmsplice01.c
testcases/kernel/syscalls/wait/wait02.c
testcases/kernel/syscalls/wait4/wait401.c
testcases/kernel/syscalls/wait4/wait402.c
testcases/kernel/syscalls/waitid/waitid01.c
testcases/kernel/syscalls/waitid/waitid02.c
testcases/kernel/timers/clock_gettime/clock_gettime03.c
testcases/kernel/timers/clock_settime/clock_settime03.c
testcases/kernel/timers/timer_create/timer_create04.c
testcases/misc/math/float/exp_log/genmodf.c
testcases/misc/math/float/main.c
testcases/network/sockets/ltpServer.c
testcases/network/tcp_cmds/perf_lan/pingpong6.c
testcases/open_posix_testsuite/conformance/interfaces/clock_settime/5-1.c
testcases/open_posix_testsuite/conformance/interfaces/clock_settime/5-2.c
testcases/open_posix_testsuite/conformance/interfaces/fork/2-1.c
testcases/open_posix_testsuite/conformance/interfaces/munlockall/5-1.c
testcases/open_posix_testsuite/conformance/interfaces/nanosleep/2-1.c
testcases/open_posix_testsuite/conformance/interfaces/pthread_join/threads_scenarii.c
testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c
testcases/open_posix_testsuite/conformance/interfaces/raise/2-1.c
testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/4-1.c
testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/5-1.c
testcases/open_posix_testsuite/conformance/interfaces/sched_rr_get_interval/3-1.c
testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/2-1.c
testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/2-2.c
testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-1.c
testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-5.c
testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/9-1.c
testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/1-1.c
testcases/open_posix_testsuite/conformance/interfaces/sem_close/3-2.c
testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-2.c
testcases/open_posix_testsuite/conformance/interfaces/sigpending/1-3.c
testcases/open_posix_testsuite/conformance/interfaces/sigwait/8-1.c
testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/2-1.c
testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/2-2.c
testcases/open_posix_testsuite/stress/threads/fork/s-c1.c
testcases/open_posix_testsuite/stress/threads/pthread_kill/stress.c
testcases/open_posix_testsuite/stress/threads/sem_getvalue/stress.c
diff --git a/testcases/kernel/syscalls/abort/abort01.c b/testcases/kernel/syscalls/abort/abort01.c
index d2f2c43..6121af6 100644
--- a/testcases/kernel/syscalls/abort/abort01.c
+++ b/testcases/kernel/syscalls/abort/abort01.c
@@ -38,13 +38,13 @@
*
*/
-#include <stdio.h>
-#include <signal.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include <errno.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
/***** LTP Port *****/
#include "test.h"
@@ -53,21 +53,27 @@
#define FAILED 0
#define PASSED 1
-//char progname[]= "abort1()";
char *TCID = "abort01";
int local_flag = PASSED;
int block_number;
FILE *temp;
int TST_TOTAL = 1;
-extern int Tst_count;
-int anyfail();
+void setup(void)
+{
+ temp = stderr;
+ tst_tmpdir();
+}
+
+void cleanup(void)
+{
+ unlink("core");
+ tst_rmdir();
+}
+
int instress();
void setup();
-void terror();
-void fail_exit();
-void ok_exit();
int forkfail();
void do_child();
@@ -81,85 +87,75 @@
int core, sig, ex;
char *msg;
- if ((msg =
- parse_opts(argc, argv, NULL, NULL)) != NULL) {
+ core = sig = ex = 0;
+
+ if ((msg = parse_opts(argc, argv, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
#ifdef UCLINUX
maybe_run_child(&do_child, "");
#endif
- setup(); /* temp file is now open */
-/*--------------------------------------------------------------*/
+ setup();
for (i = 0; i < ITER; i++) {
if ((kidpid = FORK_OR_VFORK()) == 0) {
#ifdef UCLINUX
if (self_exec(argv[0], "")) {
- terror("self_exec failed (may be OK if under stress)");
- if (instress())
- ok_exit();
- forkfail();
+ if (!instress())
+ perror("fork failed");
+ exit(1);
+ }
}
#else
do_child();
#endif
}
if (kidpid < 0) {
- terror("Fork failed (may be OK if under stress)");
- if (instress())
- ok_exit();
- forkfail();
+ if (!instress())
+ tst_brkm(TBROK|TERRNO, cleanup, "fork failed");
}
count = 0;
while ((child = wait(&status)) > 0) {
count++;
}
if (count != 1) {
- fprintf(temp, "\twrong # children waited on.\n");
- fprintf(temp, "\tgot %d, expected %d\n", count, 1);
- fail_exit();
+ tst_brkm(TBROK, cleanup,
+ "wrong # children waited on; got %d, expected 1",
+ count);
}
- /*
- sig = status & 0177;
- core = status & 0200;
- ex = (status & 0xFF00) >> 8;
- */
- /***** LTP Port *****/
- sig = WTERMSIG(status);
+ if (WIFSIGNALED(status)) {
+
#ifdef WCOREDUMP
- core = WCOREDUMP(status);
+ core = WCOREDUMP(status);
#endif
- ex = WIFEXITED(status);
+ sig = WTERMSIG(status);
+
+ }
+ if (WIFEXITED(status))
+ ex = WIFEXITED(status);
+
/**************/
- if (!core) {
- fprintf(temp, "\tChild did not return core bit set!\n");
- fprintf(temp, "\t iteration %d, exit stat = 0x%x\n",
- i, status);
- fprintf(temp, "\tCore = %d, sig = %d, ex = %d\n",
- core, sig, ex);
- local_flag = FAILED;
+ if (core == 0) {
+ tst_brkm(TFAIL, cleanup,
+ "Child did not dump core; exit code = %d, "
+ "signal = %d", ex, sig);
+ } else {
+ tst_resm(TPASS, "abort dumped core");
}
- if (sig != SIGIOT) {
- fprintf(temp, "\tChild did not exit with SIGIOT (%d)\n",
- SIGIOT);
- fprintf(temp, "\t iteration %d, exit stat = 0x%x\n",
- i, status);
- fprintf(temp, "\tCore = %d, sig = %d, ex = %d\n",
- core, sig, ex);
- local_flag = FAILED;
+
+ if (sig == SIGIOT) {
+ tst_resm(TPASS, "abort raised SIGIOT");
+ } else {
+ tst_brkm(TFAIL, cleanup,
+ "Child did not raise SIGIOT (%d); exit code = %d, "
+ "signal = %d", SIGIOT, ex, sig);
}
- if (local_flag == FAILED)
- break;
+
}
-/*--------------------------------------------------------------*/
-/* Clean up any files created by test before call to anyfail. */
-
- unlink("core");
- anyfail(); /* THIS CALL DOES NOT RETURN - EXITS!! */
- return 0;
+ cleanup();
+ tst_exit();
}
/*--------------------------------------------------------------*/
@@ -167,24 +163,8 @@
void do_child()
{
abort();
- fprintf(temp, "\tchild - abort failed.\n");
- exit(0);
-}
-
-/****** LTP Port *****/
-int anyfail()
-{
- (local_flag == FAILED) ? tst_resm(TFAIL, "Test failed") :
- tst_resm(TPASS, "Test passed");
- tst_rmdir();
- tst_exit();
- return 0;
-}
-
-void setup()
-{
- temp = stderr;
- tst_tmpdir();
+ fprintf(stderr, "\tchild - abort failed.\n");
+ exit(1);
}
int instress()
@@ -193,30 +173,3 @@
"System resources may be too low; fork(), select() etc are likely to fail.");
return 1;
}
-
-void terror(char *message)
-{
- tst_resm(TBROK, "Reason: %s:%s", message, strerror(errno));
-}
-
-void fail_exit()
-{
- local_flag = FAILED;
- anyfail();
-
-}
-
-void ok_exit()
-{
- local_flag = PASSED;
- tst_resm(TINFO, "Test passed");
-}
-
-int forkfail()
-{
- fprintf(temp, "\t\tFORK FAILED - terminating test.\n");
- tst_exit();
- return 0;
-}
-
-/*****************/
diff --git a/testcases/kernel/syscalls/accept/accept01.c b/testcases/kernel/syscalls/accept/accept01.c
index 5f62f01..352f9e0 100644
--- a/testcases/kernel/syscalls/accept/accept01.c
+++ b/testcases/kernel/syscalls/accept/accept01.c
@@ -111,10 +111,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
}
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL)) != NULL)
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
setup();
@@ -145,7 +150,7 @@
}
}
cleanup();
- return 0;
+ tst_exit();
} /* End main */
void setup(void)
@@ -164,7 +169,6 @@
void cleanup(void)
{
TEST_CLEANUP;
- tst_exit();
}
void setup0(void)
@@ -172,8 +176,7 @@
if (tdat[testno].experrno == EBADF)
s = 400; /* anything not an open file */
else if ((s = open("/dev/null", O_WRONLY)) == -1)
- tst_brkm(TBROK, cleanup, "error opening /dev/null - "
- "errno: %s", strerror(errno));
+ tst_brkm(TBROK|TERRNO, cleanup, "error opening /dev/null");
}
void cleanup0(void)
diff --git a/testcases/kernel/syscalls/access/access01.c b/testcases/kernel/syscalls/access/access01.c
index 23ce226..1da34ab 100644
--- a/testcases/kernel/syscalls/access/access01.c
+++ b/testcases/kernel/syscalls/access/access01.c
@@ -32,65 +32,65 @@
/* $Id: access01.c,v 1.8 2009/11/09 05:56:58 yaberauneya Exp $ */
/**********************************************************
*
- * OS Test - Silicon Graphics, Inc.
+ * OS Test - Silicon Graphics, Inc.
*
- * TEST IDENTIFIER : access01
+ * TEST IDENTIFIER : access01
*
- * EXECUTED BY : anyone
+ * EXECUTED BY : anyone
*
- * TEST TITLE : Basic test for access(2) using F_OK,
- * R_OK, W_OK and X_OK arguments.
+ * TEST TITLE : Basic test for access(2) using F_OK,
+ * R_OK, W_OK and X_OK arguments.
*
- * PARENT DOCUMENT : usctpl01
+ * PARENT DOCUMENT : usctpl01
*
- * TEST CASE TOTAL : 6
+ * TEST CASE TOTAL : 6
*
- * WALL CLOCK TIME : 1
+ * WALL CLOCK TIME : 1
*
- * CPU TYPES : ALL
+ * CPU TYPES : ALL
*
- * AUTHOR : William Roske
+ * AUTHOR : William Roske
*
- * CO-PILOT : Dave Fenner
+ * CO-PILOT : Dave Fenner
*
- * DATE STARTED : 03/30/92
+ * DATE STARTED : 03/30/92
*
- * INITIAL RELEASE : UNICOS 7.0
+ * INITIAL RELEASE : UNICOS 7.0
*
- * TEST CASES
+ * TEST CASES
*
* 1.) access(2) returns 0 for F_OK...(See Description)
* 2.) access(2) returns 0 for R_OK...(See Description)
* 3.) access(2) returns 0 for W_OK...(See Description)
* 4.) access(2) returns 0 for X_OK...(See Description)
*
- * INPUT SPECIFICATIONS
+ * INPUT SPECIFICATIONS
* The standard options for system call tests are accepted.
* (See the parse_opts(3) man page).
*
- * OUTPUT SPECIFICATIONS
+ * OUTPUT SPECIFICATIONS
*
- * DURATION
+ * DURATION
* Terminates - with frequency and infinite modes.
*
- * SIGNALS
+ * SIGNALS
* Uses SIGUSR1 to pause before test if option set.
* (See the parse_opts(3) man page).
*
- * RESOURCES
+ * RESOURCES
* None
*
- * ENVIRONMENTAL NEEDS
+ * ENVIRONMENTAL NEEDS
* The libcuts.a and libsys.a libraries must be included in
* the compilation of this test.
*
- * SPECIAL PROCEDURAL REQUIREMENTS
+ * SPECIAL PROCEDURAL REQUIREMENTS
* None
*
- * INTERCASE DEPENDENCIES
+ * INTERCASE DEPENDENCIES
* None
*
- * DETAILED DESCRIPTION
+ * DETAILED DESCRIPTION
* This is a Phase I test for the access(2) system call. It is intended
* to provide a limited exposure of the system call, for now. It
* should/will be extended when full functional tests are written for
@@ -130,7 +130,7 @@
void setup();
void cleanup();
-char *TCID = "access01"; /* Test program identifier. */
+char *TCID = "access01"; /* Test program identifier. */
int TST_TOTAL = 4; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
@@ -161,22 +161,27 @@
TST_TOTAL = Ntc;
+<<<<<<< HEAD
/***************************************************************
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+=======
+ /***************************************************************
+ * parse standard options
+ ***************************************************************/
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+>>>>>>> master
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
- /***************************************************************
- * perform global setup for test
- ***************************************************************/
+ /***************************************************************
+ * perform global setup for test
+ ***************************************************************/
setup();
- /***************************************************************
- * check looping state if -c option given
- ***************************************************************/
+ /***************************************************************
+ * check looping state if -c option given
+ ***************************************************************/
for (lc = 0; TEST_LOOPING(lc); lc++) {
/* reset Tst_count in case we are looping. */
@@ -191,22 +196,20 @@
/* check return code */
if (TEST_RETURN == -1 && Test_cases[tc].experrno == 0) {
tst_resm(TFAIL|TTERRNO,
- "access(%s, %s) failed",
- Test_cases[tc].file,
- Test_cases[tc].string);
+ "access(%s, %s) failed",
+ Test_cases[tc].file,
+ Test_cases[tc].string);
} else if (TEST_RETURN != -1
&& Test_cases[tc].experrno != 0) {
tst_resm(TFAIL,
- "access(%s, %s) returned %ld, exp -1, errno:%d",
- Test_cases[tc].file,
- Test_cases[tc].string, TEST_RETURN,
- Test_cases[tc].experrno);
+ "access(%s, %s) returned %ld, "
+ "exp -1, errno:%d",
+ Test_cases[tc].file,
+ Test_cases[tc].string, TEST_RETURN,
+ Test_cases[tc].experrno);
} else {
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
if (STD_FUNCTIONAL_TEST) {
/* No Verification test, yet... */
tst_resm(TPASS,
@@ -220,12 +223,11 @@
} /* End for TEST_LOOPING */
- /***************************************************************
- * cleanup and exit
- ***************************************************************/
+ /***************************************************************
+ * cleanup and exit
+ ***************************************************************/
cleanup();
-
- return 0;
+ tst_exit();
} /* End main */
/***************************************************************
@@ -253,7 +255,7 @@
*/
if (chown(".", -1, getegid()) < 0) {
tst_brkm(TBROK|TERRNO, cleanup,
- "chown(\".\", -1, %d) failed", getegid());
+ "chown(\".\", -1, %d) failed", getegid());
}
sprintf(Fname, "accessfile");
@@ -269,7 +271,8 @@
* force the mode to be set to 6777
*/
if (chmod(Fname, 06777) == -1)
- tst_brkm(TBROK|TERRNO, cleanup, "chmod(%s, 06777) failed", Fname);
+ tst_brkm(TBROK|TERRNO, cleanup, "chmod(%s, 06777) failed",
+ Fname);
stat(Fname, &stbuf);
@@ -279,7 +282,7 @@
*/
}
-} /* End setup() */
+}
/***************************************************************
* cleanup() - performs all ONE TIME cleanup for this test at
@@ -294,8 +297,4 @@
/* remove the temp dir */
tst_rmdir();
-
- /* exit with return code appropriate for results */
- tst_exit();
-
-} /* End cleanup() */
+}
diff --git a/testcases/kernel/syscalls/access/access02.c b/testcases/kernel/syscalls/access/access02.c
index 4490522..580d758 100644
--- a/testcases/kernel/syscalls/access/access02.c
+++ b/testcases/kernel/syscalls/access/access02.c
@@ -134,7 +134,11 @@
char *test_desc; /* test specific message */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -195,7 +199,7 @@
cleanup();
return 0;
- /*NOTREACHED*/}
+ }
/*
* setup() - performs all ONE TIME setup for this test.
@@ -212,7 +216,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1)
diff --git a/testcases/kernel/syscalls/access/access03.c b/testcases/kernel/syscalls/access/access03.c
index bc31f9d..cd99086 100644
--- a/testcases/kernel/syscalls/access/access03.c
+++ b/testcases/kernel/syscalls/access/access03.c
@@ -33,53 +33,53 @@
/* $Id: access03.c,v 1.8 2009/03/23 13:35:39 subrata_modak Exp $ */
/**********************************************************
*
- * OS Test - Silicon Graphics, Inc.
+ * OS Test - Silicon Graphics, Inc.
*
- * TEST IDENTIFIER : access03
+ * TEST IDENTIFIER : access03
*
- * EXECUTED BY : anyone
+ * EXECUTED BY : anyone
*
- * TEST TITLE : EFAULT error testing for access(2)
+ * TEST TITLE : EFAULT error testing for access(2)
*
- * PARENT DOCUMENT : acstds01
+ * PARENT DOCUMENT : acstds01
*
- * TEST CASE TOTAL : 8
+ * TEST CASE TOTAL : 8
*
- * WALL CLOCK TIME : 1
+ * WALL CLOCK TIME : 1
*
- * CPU TYPES : ALL
+ * CPU TYPES : ALL
*
- * AUTHOR : Kathy Olmsted
+ * AUTHOR : Kathy Olmsted
*
- * CO-PILOT : Tom Hampson
+ * CO-PILOT : Tom Hampson
*
- * DATE STARTED : 05/13/92
+ * DATE STARTED : 05/13/92
*
- * INITIAL RELEASE : UNICOS 7.0
+ * INITIAL RELEASE : UNICOS 7.0
*
- * TEST CASES
+ * TEST CASES
*
* access(2) test for errno(s) EFAULT.
*
- * INPUT SPECIFICATIONS
+ * INPUT SPECIFICATIONS
* The standard options for system call tests are accepted.
* (See the parse_opts(3) man page).
*
- * DURATION
+ * DURATION
* Terminates - with frequency and infinite modes.
*
- * SIGNALS
+ * SIGNALS
* Uses SIGUSR1 to pause before test if option set.
* (See the parse_opts(3) man page).
*
- * ENVIRONMENTAL NEEDS
- * No run-time environmental needs.
+ * ENVIRONMENTAL NEEDS
+ * No run-time environmental needs.
*
- * DETAILED DESCRIPTION
+ * DETAILED DESCRIPTION
*
* Setup:
* Setup signal handling.
- * Make and change to a temporary directory.
+ * Make and change to a temporary directory.
* Pause for SIGUSR1 if option specified.
*
* Test:
@@ -87,12 +87,12 @@
* Execute system call
* Check return code, if system call failed (return=-1)
* Log the errno.
- * If doing functional test
- * check the errno returned and print result message
+ * If doing functional test
+ * check the errno returned and print result message
*
* Cleanup:
* Print errno log and/or timing stats if options given
- * Remove the temporary directory and exit.
+ * Remove the temporary directory and exit.
*
*
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
@@ -106,12 +106,10 @@
#include "test.h"
#include "usctest.h"
-void setup();
-void cleanup();
+static void setup(void);
+static void cleanup(void);
-char *get_high_address();
-
-char *TCID = "access03"; /* Test program identifier. */
+char *TCID = "access03"; /* Test program identifier. */
int TST_TOTAL = 8; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
@@ -126,23 +124,20 @@
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
+<<<<<<< HEAD
/***************************************************************
* parse standard options
***************************************************************/
+=======
+>>>>>>> master
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /***************************************************************
- * perform global setup for test
- ***************************************************************/
setup();
/* set the expected errnos. */
TEST_EXP_ENOS(exp_enos);
- /***************************************************************
- * check looping state if -c option given
- ***************************************************************/
for (lc = 0; TEST_LOOPING(lc); lc++) {
/* reset Tst_count in case we are looping. */
@@ -161,9 +156,6 @@
TEST_ERROR_LOG(TEST_ERRNO);
}
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
if (STD_FUNCTIONAL_TEST) {
if (TEST_RETURN == -1) {
if (TEST_ERRNO == EFAULT) {
@@ -197,9 +189,6 @@
TEST_ERROR_LOG(TEST_ERRNO);
}
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
if (STD_FUNCTIONAL_TEST) {
if (TEST_RETURN == -1) {
if (TEST_ERRNO == EFAULT) {
@@ -233,9 +222,6 @@
TEST_ERROR_LOG(TEST_ERRNO);
}
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
if (STD_FUNCTIONAL_TEST) {
if (TEST_RETURN == -1) {
if (TEST_ERRNO == EFAULT) {
@@ -269,9 +255,6 @@
TEST_ERROR_LOG(TEST_ERRNO);
}
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
if (STD_FUNCTIONAL_TEST) {
if (TEST_RETURN == -1) {
if (TEST_ERRNO == EFAULT) {
@@ -305,9 +288,6 @@
TEST_ERROR_LOG(TEST_ERRNO);
}
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
if (STD_FUNCTIONAL_TEST) {
if (TEST_RETURN == -1) {
if (TEST_ERRNO == EFAULT) {
@@ -341,9 +321,6 @@
TEST_ERROR_LOG(TEST_ERRNO);
}
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
if (STD_FUNCTIONAL_TEST) {
if (TEST_RETURN == -1) {
if (TEST_ERRNO == EFAULT) {
@@ -377,9 +354,6 @@
TEST_ERROR_LOG(TEST_ERRNO);
}
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
if (STD_FUNCTIONAL_TEST) {
if (TEST_RETURN == -1) {
if (TEST_ERRNO == EFAULT) {
@@ -395,8 +369,8 @@
}
} else {
tst_resm(TFAIL,
- "access(high_address,X_OK) succeeded unexpectedly.");
-
+ "access(high_address, X_OK) succeeded "
+ "unexpectedly.");
}
}
@@ -405,52 +379,44 @@
* F_OK on high pointer (sbrk(0)+1) for path
*/
- /* Call access(2) */
TEST(access(get_high_address(), F_OK));
- /* check return code */
if (TEST_RETURN == -1) {
TEST_ERROR_LOG(TEST_ERRNO);
}
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
if (STD_FUNCTIONAL_TEST) {
if (TEST_RETURN == -1) {
if (TEST_ERRNO == EFAULT) {
- tst_resm(TPASS,
- "access((char*)sbrk(0)+1,F_OK) failed as expected with errno %d (EFAULT) : %s",
- TEST_ERRNO,
- strerror(TEST_ERRNO));
+ tst_resm(TPASS|TTERRNO,
+ "access((char*)sbrk(0)+1,F_OK) "
+ "failed as expected with EFAULT");
} else {
- tst_resm(TFAIL,
- "access((char*)sbrk(0)+1,F_OK) failed with errno %d : %s but expected %d (EFAULT)",
- TEST_ERRNO,
- strerror(TEST_ERRNO), EFAULT);
+ tst_resm(TFAIL|TTERRNO,
+ "access((char*)sbrk(0)+1,F_OK) "
+ " did not fail with EFAULT");
}
} else {
tst_resm(TFAIL,
- "access((char*)sbrk(0)+1,F_OK) succeeded unexpectedly.");
-
+ "access((char*)sbrk(0)+1,F_OK) "
+ "succeeded unexpectedly.");
}
}
} /* End for TEST_LOOPING */
- /***************************************************************
- * cleanup and exit
- ***************************************************************/
+ /***************************************************************
+ * cleanup and exit
+ ***************************************************************/
cleanup();
-
- return 0;
+ tst_exit();
} /* End main */
#else
int main()
{
- tst_resm(TINFO, "test is not available on uClinux");
+ tst_resm(TCONF, "test is not available on uClinux");
return 0;
}
@@ -471,12 +437,12 @@
tst_tmpdir();
bad_addr =
- mmap(0, 1, PROT_NONE, MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, 0,
- 0);
+ mmap(0, 1, PROT_NONE,
+ MAP_PRIVATE_EXCEPT_UCLINUX|MAP_ANONYMOUS, 0, 0);
if (bad_addr == MAP_FAILED) {
tst_brkm(TBROK, cleanup, "mmap failed");
}
-} /* End setup() */
+}
/***************************************************************
* cleanup() - performs all ONE TIME cleanup for this test at
@@ -493,5 +459,4 @@
/* remove the temporary directory and exit with
return code appropriate for results */
tst_rmdir();
- tst_exit();
-} /* End cleanup() */
+}
diff --git a/testcases/kernel/syscalls/access/access04.c b/testcases/kernel/syscalls/access/access04.c
index 4019db0..e9d232e 100644
--- a/testcases/kernel/syscalls/access/access04.c
+++ b/testcases/kernel/syscalls/access/access04.c
@@ -100,9 +100,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform global setup for test */
@@ -151,7 +157,7 @@
cleanup();
return 0;
- /*NOTREACHED*/}
+ }
/*
* setup() - performs all ONE TIME setup for this test.
@@ -169,7 +175,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1)
diff --git a/testcases/kernel/syscalls/access/access05.c b/testcases/kernel/syscalls/access/access05.c
index 3fc424e..1ee7ec3 100644
--- a/testcases/kernel/syscalls/access/access05.c
+++ b/testcases/kernel/syscalls/access/access05.c
@@ -161,9 +161,15 @@
int ind; /* counter for testcase looping */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform global setup for test */
@@ -223,7 +229,7 @@
cleanup();
return 0;
- /*NOTREACHED*/}
+ }
/*
* setup() - performs all ONE TIME setup for this test.
@@ -240,7 +246,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1)
diff --git a/testcases/kernel/syscalls/add_key/add_key01.c b/testcases/kernel/syscalls/add_key/add_key01.c
index e3b6ea8..1501f8c 100644
--- a/testcases/kernel/syscalls/add_key/add_key01.c
+++ b/testcases/kernel/syscalls/add_key/add_key01.c
@@ -78,9 +78,6 @@
/* Remove tmp dir and all files in it */
TEST_CLEANUP;
tst_rmdir();
-
- /* Exit with appropriate return code. */
- tst_exit();
}
/* Local Functions */
@@ -113,39 +110,42 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
} else {
setup();
+=======
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
- /* Check looping state if -i option given */
- for (lc = 0; TEST_LOOPING(lc); ++lc) {
+ setup();
- Tst_count = 0;
+ /* Check looping state if -i option given */
+ for (lc = 0; TEST_LOOPING(lc); ++lc) {
- for (testno = 0; testno < TST_TOTAL; ++testno) {
+ Tst_count = 0;
- /* Call add_key. */
- TEST(syscall(__NR_add_key, "keyring", "wjkey",
- NULL, 0,
- KEY_SPEC_THREAD_KEYRING));
+ for (testno = 0; testno < TST_TOTAL; ++testno) {
- if (TEST_RETURN != -1) {
- tst_resm(TPASS, "add_key call succeeded");
- cleanup();
- } else {
- tst_resm(TFAIL | TTERRNO, "%s failed", TCID);
- }
-
+ /* Call add_key. */
+ TEST(syscall(__NR_add_key, "keyring", "wjkey",
+ NULL, 0,
+ KEY_SPEC_THREAD_KEYRING));
+ if (TEST_RETURN != -1) {
+ tst_brkm(TPASS, cleanup,
+ "add_key call succeeded");
+ } else {
+ tst_resm(TFAIL|TTERRNO, "%s failed", TCID);
}
}
- cleanup();
+ }
- }
-
+ cleanup();
tst_exit();
}
diff --git a/testcases/kernel/syscalls/add_key/add_key02.c b/testcases/kernel/syscalls/add_key/add_key02.c
index 3622328..cd6d06c 100644
--- a/testcases/kernel/syscalls/add_key/add_key02.c
+++ b/testcases/kernel/syscalls/add_key/add_key02.c
@@ -78,9 +78,6 @@
/* Remove tmp dir and all files in it */
TEST_CLEANUP;
tst_rmdir();
-
- /* Exit with appropriate return code. */
- tst_exit();
}
/* Local Functions */
@@ -122,72 +119,65 @@
int main(int ac, char **av) {
- int i, succeed=0, fail=0;
+ int i;
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
} else {
+=======
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
- setup();
+ setup();
- /* Check looping state if -i option given */
- for (lc = 0; TEST_LOOPING(lc); ++lc) {
- Tst_count = 0;
- for (testno = 0; testno < TST_TOTAL; ++testno) {
+ /* Check looping state if -i option given */
+ for (lc = 0; TEST_LOOPING(lc); ++lc) {
+ Tst_count = 0;
+ for (testno = 0; testno < TST_TOTAL; ++testno) {
+<<<<<<< HEAD
for (i=0; i<test_count; i++) {
+=======
+ for (i=0; i<test_count; i++) {
+>>>>>>> master
- /* Call add_key. */
- TEST(syscall(__NR_add_key, test_cases[i].type,
- test_cases[i].desc,
- test_cases[i].payload,
- test_cases[i].plen,
- KEY_SPEC_USER_KEYRING));
+ /* Call add_key. */
+ TEST(syscall(__NR_add_key, test_cases[i].type,
+ test_cases[i].desc,
+ test_cases[i].payload,
+ test_cases[i].plen,
+ KEY_SPEC_USER_KEYRING));
- if (TEST_RETURN != -1) {
- tst_resm(TINFO,"call add_key() with wrong args succeed, but should fail");
- fail++;
+ if (TEST_RETURN != -1) {
+ tst_resm(TINFO,
+ "add_key passed unexpectedly");
+ } else {
+
+ if (errno == test_cases[i].exp_errno) {
+ tst_resm(TINFO|TTERRNO,
+ "called add_key() "
+ "with wrong args got "
+ "EXPECTED errno");
} else {
-
- if (errno == test_cases[i].exp_errno) {
- tst_resm(TINFO | TTERRNO,
- "called "
- "add_key() "
- "with wrong "
- "args got "
- "EXPECTED "
- "errno");
- succeed++;
- } else {
- tst_resm(TINFO | TTERRNO,
- "called "
- "add_key() "
- "with wrong "
- "args got "
- "UNEXPECTED "
- "errno");
- fail++;
- }
-
+ tst_resm(TFAIL|TTERRNO,
+ "called add_key() "
+ "with wrong args got "
+ "UNEXPECTED errno");
}
}
}
-
- if (fail != 0) {
- tst_resm(TFAIL | TTERRNO, "%s failed", TCID);
- } else {
- tst_resm(TPASS, "add_key call succeeded");
- }
}
- cleanup();
+ }
- }
+ cleanup();
tst_exit();
}
diff --git a/testcases/kernel/syscalls/adjtimex/adjtimex01.c b/testcases/kernel/syscalls/adjtimex/adjtimex01.c
index 162f622..8b231bf 100644
--- a/testcases/kernel/syscalls/adjtimex/adjtimex01.c
+++ b/testcases/kernel/syscalls/adjtimex/adjtimex01.c
@@ -93,10 +93,8 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL))
- != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/* perform global setup for test */
setup();
@@ -123,7 +121,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -132,7 +130,7 @@
{
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
tim_save.modes = 0;
@@ -160,7 +158,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
} /* End cleanup() */
diff --git a/testcases/kernel/syscalls/adjtimex/adjtimex02.c b/testcases/kernel/syscalls/adjtimex/adjtimex02.c
index 24a4db7..01d4dc2 100644
--- a/testcases/kernel/syscalls/adjtimex/adjtimex02.c
+++ b/testcases/kernel/syscalls/adjtimex/adjtimex02.c
@@ -144,10 +144,8 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL))
- != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/* perform global setup for test */
setup();
@@ -201,7 +199,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -213,7 +211,7 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* capture signals */
@@ -225,7 +223,7 @@
/* set the HZ from sysconf */
hz = sysconf(_SC_CLK_TCK);
if (hz == -1) {
- tst_brkm(TBROK, tst_exit,
+ tst_brkm(TBROK, NULL,
"Failed to read the HZ from sysconf\n");
}
@@ -234,7 +232,7 @@
/* Save current parameters in tim_save */
if ((adjtimex(&tim_save)) == -1) {
- tst_brkm(TBROK, tst_exit, "Failed to save current parameters");
+ tst_brkm(TBROK, NULL, "Failed to save current parameters");
}
} /* End setup() */
@@ -255,9 +253,6 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
} /* End cleanup() */
int setup2()
@@ -288,7 +283,7 @@
{
/* Switch to nobody user for correct error code collection */
if ((ltpuser = getpwnam(nobody_uid)) == NULL) {
- tst_brkm(TBROK, tst_exit, "\"nobody\" user not present");
+ tst_brkm(TBROK, NULL, "\"nobody\" user not present");
}
if (seteuid(ltpuser->pw_uid) == -1) {
tst_resm(TWARN|TERRNO, "seteuid(%d) failed", ltpuser->pw_uid);
diff --git a/testcases/kernel/syscalls/alarm/alarm01.c b/testcases/kernel/syscalls/alarm/alarm01.c
index 50edd8e..02f6bbe 100644
--- a/testcases/kernel/syscalls/alarm/alarm01.c
+++ b/testcases/kernel/syscalls/alarm/alarm01.c
@@ -127,22 +127,11 @@
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
- /***************************************************************
- * parse standard options
- ***************************************************************/
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
- /***************************************************************
- * perform global setup for test
- ***************************************************************/
setup();
- /***************************************************************
- * check looping state if -c option given
- ***************************************************************/
for (lc = 0; TEST_LOOPING(lc); lc++) {
/* reset Tst_count in case we are looping. */
@@ -158,9 +147,6 @@
tst_resm(TFAIL|TTERRNO, "alarm(1) failed");
} else {
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
if (STD_FUNCTIONAL_TEST) {
/* No Verification test, yet... */
tst_resm(TPASS, "alarm(1) returned %ld",
@@ -170,17 +156,10 @@
} /* End for TEST_LOOPING */
- /***************************************************************
- * cleanup and exit
- ***************************************************************/
cleanup();
-
- return 0;
+ tst_exit();
} /* End main */
-/***************************************************************
- * setup() - performs all ONE TIME setup for this test.
- ***************************************************************/
void setup()
{
void trapper();
@@ -205,13 +184,9 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
} /* End cleanup() */
-void trapper(sig)
-int sig;
+void trapper(int sig)
{
signal(SIGALRM, trapper);
}
diff --git a/testcases/kernel/syscalls/alarm/alarm02.c b/testcases/kernel/syscalls/alarm/alarm02.c
index 1353774..8621dd4 100644
--- a/testcases/kernel/syscalls/alarm/alarm02.c
+++ b/testcases/kernel/syscalls/alarm/alarm02.c
@@ -120,23 +120,11 @@
int exp[] = { 0, 0, 0 };
int i;
- /***************************************************************
- * parse standard options
- ***************************************************************/
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
-
- /***************************************************************
- * perform global setup for test
- ***************************************************************/
setup();
- /***************************************************************
- * check looping state
- ***************************************************************/
for (lc = 0; TEST_LOOPING(lc); lc++) {
/* reset Tst_count in case we are looping. */
@@ -157,11 +145,7 @@
"alarm(%lu) returned %ld, when %u was expected for value %s",
sec[i], TEST_RETURN, exp[i], buf[i]);
- }
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
- else if (STD_FUNCTIONAL_TEST) {
+ } else if (STD_FUNCTIONAL_TEST) {
if (received_alarm == 1) {
tst_resm(TFAIL,
"alarm(%lu) returned %ldu but an alarm signal was received for value %s",
@@ -183,14 +167,10 @@
} /* End for TEST_LOOPING */
cleanup();
+ tst_exit();
- return 0;
}
-/***************************************************************
- * setup() - performs all ONE TIME setup for this test.
- ***************************************************************/
-
void setup()
{
@@ -204,11 +184,6 @@
}
-/***********************************************************
- * Cleanup:
- * exit using tst_exit.
- ***********************************************************/
-
void cleanup()
{
/*
@@ -216,10 +191,6 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
-
- tst_exit();
}
void alarm_received()
diff --git a/testcases/kernel/syscalls/alarm/alarm03.c b/testcases/kernel/syscalls/alarm/alarm03.c
index a3ba0d5..cc8ee18 100644
--- a/testcases/kernel/syscalls/alarm/alarm03.c
+++ b/testcases/kernel/syscalls/alarm/alarm03.c
@@ -112,24 +112,13 @@
{
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
- int e_code, status, retval = 0;
+ int status, retval = 0;
- /***************************************************************
- * parse standard options
- ***************************************************************/
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
- /***************************************************************
- * perform global setup for test
- ***************************************************************/
setup();
- /***************************************************************
- * check looping state if -c option given
- ***************************************************************/
for (lc = 0; TEST_LOOPING(lc); lc++) {
/* reset Tst_count in case we are looping. */
@@ -178,9 +167,7 @@
}
/* wait for the child to finish */
wait(&status);
- /* make sure the child returned a good exit status */
- e_code = status >> 8;
- if ((e_code != 0) || (retval != 0)) {
+ if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
tst_resm(TFAIL, "Failures reported above");
}
@@ -189,8 +176,7 @@
} /* End for TEST_LOOPING */
cleanup();
-
- return 0;
+ tst_exit();
} /* End main */
void setup()
@@ -211,9 +197,6 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
} /* End cleanup() */
void trapper(int sig)
diff --git a/testcases/kernel/syscalls/alarm/alarm05.c b/testcases/kernel/syscalls/alarm/alarm05.c
index 0a32a26..e05bbc6 100644
--- a/testcases/kernel/syscalls/alarm/alarm05.c
+++ b/testcases/kernel/syscalls/alarm/alarm05.c
@@ -79,7 +79,7 @@
char *TCID = "alarm05"; /* Test program identifier. */
int TST_TOTAL = 1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
-int almreceived = 0; /* flag to indicate SIGALRM received or not */
+int alarms_received = 0; /* flag to indicate SIGALRM received or not */
void setup(); /* Main setup function of test */
void cleanup(); /* cleanup function for the test */
@@ -97,10 +97,8 @@
int sleep_time2 = 6; /* waiting time for the signal */
/* Parse standard options given to run the test. */
- msg = parse_opts(ac, av, NULL, NULL);
- if (msg != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/* Perform global setup for test */
setup();
@@ -110,10 +108,10 @@
/* Reset Tst_count in case we are looping. */
Tst_count = 0;
- /* Reset almreceived for every iteration, since it has
+ /* Reset alarms_received for every iteration, since it has
* old values from previous iterations (if any) and not
* a value of zero */
- almreceived = 0;
+ alarms_received = 0;
/*
* Call First alarm() with non-zero time parameter
@@ -140,10 +138,10 @@
* the amount of time previously remaining in the
* alarm clock of the calling process, and
* sigproc() executed when SIGALRM received by the
- * process, the variable almreceived is set.
+ * process, the variable alarms_received is set.
*/
if (STD_FUNCTIONAL_TEST) {
- if ((almreceived == 1) &&
+ if ((alarms_received == 1) &&
(ret_val2 == (time_sec1 - sleep_time1))) {
/*
@@ -163,19 +161,17 @@
}
} else {
tst_resm(TFAIL, "alarm(%u) fails, returned %d, "
- "almreceived:%d",
- time_sec2, ret_val2, almreceived);
+ "alarms_received:%d",
+ time_sec2, ret_val2, alarms_received);
}
} else {
tst_resm(TPASS, "call succeeded");
}
} /* End for TEST_LOOPING */
- /* Call cleanup() to undo setup done for the test. */
cleanup();
-
- return 0;
- /*NOTREACHED*/}
+ tst_exit();
+}
/*
* setup() - performs all ONE TIME setup for this test.
@@ -204,7 +200,7 @@
*/
void sigproc(int sig)
{
- almreceived = almreceived + 1;
+ alarms_received++;
}
/*
@@ -219,7 +215,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/alarm/alarm06.c b/testcases/kernel/syscalls/alarm/alarm06.c
index d26ee2f..a117b7c 100644
--- a/testcases/kernel/syscalls/alarm/alarm06.c
+++ b/testcases/kernel/syscalls/alarm/alarm06.c
@@ -77,7 +77,7 @@
char *TCID = "alarm06"; /* Test program identifier. */
int TST_TOTAL = 1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
-int almreceived = 0; /* flag to indicate SIGALRM received or not */
+int alarms_received = 0; /* flag to indicate SIGALRM received or not */
void setup(); /* Main setup function of test */
void cleanup(); /* cleanup function for the test */
@@ -94,10 +94,8 @@
int sleep_time2 = 10; /* waiting time for the 2nd signal */
/* Parse standard options given to run the test. */
- msg = parse_opts(ac, av, NULL, NULL);
- if (msg != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/* Perform global setup for test */
setup();
@@ -132,17 +130,17 @@
* the amount of time (seconds) previously remaining in the
* alarm clock of the calling process, and
* sigproc() never executed as SIGALRM was not received by the
- * process, the variable almreceived remains unset.
+ * process, the variable alarms_received remains unset.
*/
if (STD_FUNCTIONAL_TEST) {
- if ((almreceived == 0) &&
+ if ((alarms_received == 0) &&
(ret_val2 == (time_sec1 - sleep_time1))) {
tst_resm(TPASS, "Functionality of alarm(%u) "
"successful", time_sec2);
} else {
tst_resm(TFAIL, "alarm(%u) fails, returned %d, "
- "almreceived:%d",
- time_sec2, ret_val2, almreceived);
+ "alarms_received:%d",
+ time_sec2, ret_val2, alarms_received);
}
} else {
tst_resm(TPASS, "last call returned %d", ret_val2);
@@ -151,9 +149,8 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
-
- return 0;
- /*NOTREACHED*/}
+ tst_exit();
+}
/*
* setup() - performs all ONE TIME setup for this test.
@@ -182,7 +179,7 @@
*/
void sigproc(int sig)
{
- almreceived = almreceived + 1;
+ alarms_received++;
}
/*
@@ -196,7 +193,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/alarm/alarm07.c b/testcases/kernel/syscalls/alarm/alarm07.c
index 99c51e0..6d506bb 100644
--- a/testcases/kernel/syscalls/alarm/alarm07.c
+++ b/testcases/kernel/syscalls/alarm/alarm07.c
@@ -76,7 +76,7 @@
char *TCID = "alarm07"; /* Test program identifier. */
int TST_TOTAL = 1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
-int almreceived = 0; /* flag to indicate SIGALRM received or not */
+int alarms_received = 0; /* flag to indicate SIGALRM received or not */
void setup(); /* Main setup function of test */
void cleanup(); /* cleanup function for the test */
@@ -86,15 +86,14 @@
{
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
- int time_sec = 3; /* time for which alarm is set */
int sleep_time = 5; /* waiting time for the SIGALRM signal */
+ int status;
+ int time_sec = 3; /* time for which alarm is set */
pid_t cpid; /* child process id */
/* Parse standard options given to run the test. */
- msg = parse_opts(ac, av, NULL, NULL);
- if (msg != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/* Perform global setup for test */
setup();
@@ -122,20 +121,26 @@
if (STD_FUNCTIONAL_TEST) {
if (cpid == 0) { /* Child process */
/*
- * For child process if almreceived is 0
+ * For child process if alarms_received is 0
* means alarm request is cleared.
*/
- if (almreceived == 0) {
- printf("Functionality of alarm(%u) "
- "successful\n", time_sec);
+ if (alarms_received == 0) {
+ exit(0);
} else {
printf("alarm request not cleared in "
- "child, almreceived:%d\n",
- almreceived);
+ "child; alarms received:%d\n",
+ alarms_received);
+ exit(1);
}
} else { /* Parent process */
/* Wait for child to complete execution */
- wait(0);
+ if (wait(&status) == -1)
+ tst_brkm(TBROK|TERRNO, cleanup,
+ "wait failed");
+ if (!WIFEXITED(status) ||
+ WEXITSTATUS(status) != 0)
+ tst_brkm(TBROK|TERRNO, cleanup,
+ "child exited abnormally");
}
} else {
tst_resm(TPASS, "call returned %ld", TEST_RETURN);
@@ -145,8 +150,8 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- return 0;
- /*NOTREACHED*/} /* End main */
+ tst_exit();
+} /* End main */
/*
* setup() - performs all ONE TIME setup for this test.
@@ -162,8 +167,7 @@
/* Set the signal catching function */
if (signal(SIGALRM, sigproc) == SIG_ERR) {
- tst_brkm(TFAIL|TERRNO, cleanup,
- "signal() fails to catch SIGALARM");
+ tst_brkm(TFAIL|TERRNO, cleanup, "signal(SIGALRM, ..) failed");
}
}
@@ -175,7 +179,7 @@
*/
void sigproc(int sig)
{
- almreceived = almreceived + 1;
+ alarms_received++;
}
/*
@@ -189,7 +193,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/asyncio/asyncio02.c b/testcases/kernel/syscalls/asyncio/asyncio02.c
index 8497fb3..a4b371c 100644
--- a/testcases/kernel/syscalls/asyncio/asyncio02.c
+++ b/testcases/kernel/syscalls/asyncio/asyncio02.c
@@ -154,22 +154,19 @@
Num_flags = sizeof(Flags) / sizeof(int);
TST_TOTAL = 3 * Num_flags;
+<<<<<<< HEAD
/***************************************************************
* parse standard options, and exit if there is an error
***************************************************************/
+=======
+>>>>>>> master
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
}
- /***************************************************************
- * perform global setup for test
- ***************************************************************/
setup();
- /***************************************************************
- * check looping state if -c option given
- ***************************************************************/
for (lc = 0; TEST_LOOPING(lc); lc++) {
/* reset Tst_count in case we are looping. */
@@ -224,24 +221,13 @@
}
}
cleanup();
-
- return 0;
+ tst_exit();
} /* end main() */
-/***********************************************************
- *
- * This function does the actual running of the tests.
- *
- ***********************************************************/
int testrun(int flag, int bytes, int ti)
{
- void cleanup();
-
- int fildes, /* temporary file's descriptor */
- i; /* counter */
-
- int ret;
+ int fildes, i, ret;
struct stat buffer; /* buffer of memory required for stat command */
@@ -339,8 +325,4 @@
/* remove temporary directory and all files in it. */
tst_rmdir();
-
- /* exit with return code appropriate for results */
- tst_exit();
-
} /* End cleanup() */
diff --git a/testcases/kernel/syscalls/bdflush/bdflush01.c b/testcases/kernel/syscalls/bdflush/bdflush01.c
index 042f0aa..7873b0b 100644
--- a/testcases/kernel/syscalls/bdflush/bdflush01.c
+++ b/testcases/kernel/syscalls/bdflush/bdflush01.c
@@ -1,31 +1,31 @@
/******************************************************************************/
-/* Copyright (c) Crackerjack Project., 2007 */
-/* */
+/* Copyright (c) Crackerjack Project., 2007 */
+/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
-/* the Free Software Foundation; either version 2 of the License, or */
-/* (at your option) any later version. */
-/* */
-/* This program is distributed in the hope that it will be useful, */
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */
-/* the GNU General Public License for more details. */
-/* */
-/* You should have received a copy of the GNU General Public License */
-/* along with this program; if not, write to the Free Software */
+/* the Free Software Foundation; either version 2 of the License, or */
+/* (at your option) any later version. */
+/* */
+/* This program is distributed in the hope that it will be useful, */
+/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
+/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */
+/* the GNU General Public License for more details. */
+/* */
+/* You should have received a copy of the GNU General Public License */
+/* along with this program; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* */
+/* */
/******************************************************************************/
/******************************************************************************/
-/* */
-/* File: bdflush01.c */
-/* */
+/* */
+/* File: bdflush01.c */
+/* */
/* Description: bdflush() starts, flushes, or tunes the buffer-dirty-flush */
/* daemon. Only a privileged process (one with the CAP_SYS_ADMIN */
/* capability) may call bdflush(). */
/* */
/* If func is negative or 0, and no daemon has been started, */
-/* then bdflush() enters the daemon code and never returns. */
+/* then bdflush() enters the daemon code and never returns. */
/* */
/* If func is 1, some dirty buffers are written to disk. */
/* If func is 2 or more and is even (low bit is 0), then address */
@@ -59,20 +59,20 @@
/* EPERM */
/* Caller does not have the CAP_SYS_ADMIN capability.*/
/* */
-/* Usage: <for command-line> */
-/* bdflush01 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
-/* where, -c n : Run n copies concurrently. */
-/* -e : Turn on errno logging. */
-/* -i n : Execute test n times. */
-/* -I x : Execute test for x seconds. */
-/* -P x : Pause for x seconds between iterations. */
-/* -t : Turn on syscall timing. */
-/* */
-/* Total Tests: 1 */
-/* */
-/* Test Name: bdflush01 */
-/* History: Porting from Crackerjack to LTP is done by */
-/* Manas Kumar Nayak maknayak@in.ibm.com> */
+/* Usage: <for command-line> */
+/* bdflush01 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
+/* where, -c n : Run n copies concurrently. */
+/* -e : Turn on errno logging. */
+/* -i n : Execute test n times. */
+/* -I x : Execute test for x seconds. */
+/* -P x : Pause for x seconds between iterations. */
+/* -t : Turn on syscall timing. */
+/* */
+/* Total Tests: 1 */
+/* */
+/* Test Name: bdflush01 */
+/* History: Porting from Crackerjack to LTP is done by */
+/* Manas Kumar Nayak maknayak@in.ibm.com> */
/******************************************************************************/
#include <stdio.h>
#include <stdlib.h>
@@ -89,65 +89,72 @@
#include "linux_syscall_numbers.h"
/* Extern Global Variables */
-extern int Tst_count; /* counter for tst_xxx routines. */
-extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */
+extern int Tst_count; /* counter for tst_xxx routines. */
+extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */
/* Global Variables */
char *TCID = "bdflush01"; /* Test program identifier.*/
int testno;
-int TST_TOTAL = 1; /* total number of tests in this file. */
+int TST_TOTAL = 1; /* total number of tests in this file. */
/* Extern Global Functions */
/******************************************************************************/
-/* */
-/* Function: cleanup */
-/* */
+/* */
+/* Function: cleanup */
+/* */
/* Description: Performs all one time clean up for this test on successful */
-/* completion, premature exit or failure. Closes all temporary */
-/* files, removes all temporary directories exits the test with */
-/* appropriate return code by calling tst_exit() function. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
+/* completion, premature exit or failure. Closes all temporary */
+/* files, removes all temporary directories exits the test with */
+/* appropriate return code by calling tst_exit() function. */
+/* */
+/* Input: None. */
+/* */
+/* Output: None. */
+/* */
/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */
-/* On success - Exits calling tst_exit(). With '0' return code. */
-/* */
+/* On success - Exits calling tst_exit(). With '0' return code. */
+/* */
/******************************************************************************/
extern void cleanup() {
+<<<<<<< HEAD
/* Remove tmp dir and all files in it */
TEST_CLEANUP;
tst_rmdir();
+=======
+ /* Remove tmp dir and all files in it */
+ TEST_CLEANUP;
+ tst_rmdir();
+>>>>>>> master
}
/* Local Functions */
/******************************************************************************/
-/* */
-/* Function: setup */
-/* */
+/* */
+/* Function: setup */
+/* */
/* Description: Performs all one time setup for this test. This function is */
-/* typically used to capture signals, create temporary dirs */
-/* and temporary files that may be used in the course of this */
-/* test. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits by calling cleanup(). */
-/* On success - returns 0. */
-/* */
+/* typically used to capture signals, create temporary dirs */
+/* and temporary files that may be used in the course of this */
+/* test. */
+/* */
+/* Input: None. */
+/* */
+/* Output: None. */
+/* */
+/* Return: On failure - Exits by calling cleanup(). */
+/* On success - returns 0. */
+/* */
/******************************************************************************/
void setup() {
- /* Capture signals if any */
- /* Create temporary directories */
- TEST_PAUSE;
- tst_tmpdir();
+ /* Capture signals if any */
+ /* Create temporary directories */
+ TEST_PAUSE;
+ tst_tmpdir();
}
int main(int ac, char **av) {
long data;
+<<<<<<< HEAD
char *msg; /* message returned from parse_opts */
/* parse standard options */
@@ -156,16 +163,36 @@
setup();
+=======
+ int lc; /* loop counter */
+ char *msg; /* message returned from parse_opts */
+
+ /* parse standard options */
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+
+ setup();
+
+ /* Check looping state if -i option given */
+>>>>>>> master
Tst_count = 1;
for (testno = 0; testno < TST_TOTAL; ++testno) {
TEST(syscall(__NR_bdflush, 0, data));
if (TEST_RETURN < 0) {
+<<<<<<< HEAD
tst_brkm(TFAIL|TTERRNO, cleanup, "bdflush() failed");
} else {
tst_resm(TPASS, "test PASSED; %ld was returned",
TEST_RETURN);
}
}
+=======
+ tst_brkm(TFAIL|TTERRNO, cleanup, "bdflush failed");
+ } else {
+ tst_resm(TPASS, "bdflush() = %ld", TEST_RETURN);
+ }
+ }
+>>>>>>> master
cleanup();
tst_exit();
}
diff --git a/testcases/kernel/syscalls/bind/bind01.c b/testcases/kernel/syscalls/bind/bind01.c
index ed88e69..2df6b8c 100644
--- a/testcases/kernel/syscalls/bind/bind01.c
+++ b/testcases/kernel/syscalls/bind/bind01.c
@@ -114,7 +114,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, 0, "OPTION PARSING ERROR - %s", msg);
tst_exit();
diff --git a/testcases/kernel/syscalls/cacheflush/cacheflush01.c b/testcases/kernel/syscalls/cacheflush/cacheflush01.c
index fe40234..60bab0b 100644
--- a/testcases/kernel/syscalls/cacheflush/cacheflush01.c
+++ b/testcases/kernel/syscalls/cacheflush/cacheflush01.c
@@ -139,7 +139,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
tst_exit();
}
diff --git a/testcases/kernel/syscalls/capget/capget01.c b/testcases/kernel/syscalls/capget/capget01.c
index 6629076..164c274 100644
--- a/testcases/kernel/syscalls/capget/capget01.c
+++ b/testcases/kernel/syscalls/capget/capget01.c
@@ -98,9 +98,15 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -127,7 +133,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/capget/capget02.c b/testcases/kernel/syscalls/capget/capget02.c
index f7c9139..a582f92 100644
--- a/testcases/kernel/syscalls/capget/capget02.c
+++ b/testcases/kernel/syscalls/capget/capget02.c
@@ -128,9 +128,15 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -162,7 +168,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/capset/capset01.c b/testcases/kernel/syscalls/capset/capset01.c
index fb43878..b794144 100644
--- a/testcases/kernel/syscalls/capset/capset01.c
+++ b/testcases/kernel/syscalls/capset/capset01.c
@@ -104,10 +104,8 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL))
- != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/* perform global setup for test */
setup();
@@ -132,7 +130,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -155,7 +153,7 @@
header.version = _LINUX_CAPABILITY_VERSION;
header.pid = 0;
if ((capget(&header, &data)) == -1) {
- tst_brkm(TBROK|TTERRNO, tst_exit, "capget() failed");
+ tst_brkm(TBROK|TTERRNO, NULL, "capget() failed");
}
} /* End setup() */
@@ -171,8 +169,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
- /* End cleanup() */
}
diff --git a/testcases/kernel/syscalls/capset/capset02.c b/testcases/kernel/syscalls/capset/capset02.c
index 3fcc641..151197a 100644
--- a/testcases/kernel/syscalls/capset/capset02.c
+++ b/testcases/kernel/syscalls/capset/capset02.c
@@ -137,10 +137,8 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL))
- != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
#ifdef UCLINUX
maybe_run_child(&child_func, "");
#endif
@@ -175,7 +173,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -198,7 +196,7 @@
*/
header.version = _LINUX_CAPABILITY_VERSION;
if ((capget(&header, &data)) == -1) {
- tst_brkm(TBROK|TERRNO, tst_exit, "capget() failed");
+ tst_brkm(TBROK|TERRNO, NULL, "capget() failed");
}
} /* End setup() */
@@ -216,9 +214,6 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
} /* End cleanup() */
void child_func()
diff --git a/testcases/kernel/syscalls/chdir/chdir01.c b/testcases/kernel/syscalls/chdir/chdir01.c
index 0cf4605..b75ef3d 100644
--- a/testcases/kernel/syscalls/chdir/chdir01.c
+++ b/testcases/kernel/syscalls/chdir/chdir01.c
@@ -81,7 +81,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -97,13 +101,13 @@
if ((ret = chdir(testdir)) != 0) {
tst_brkm(TBROK|TERRNO, cleanup, "chdir(%s) failed", testdir);
- /*NOTREACHED*/}
+ }
if ((fd = creat(filname, 0000)) == -1) {
tst_brkm(TBROK|TERRNO, cleanup, "creat(%s) failed", filname);
- /*NOTREACHED*/}
+ }
if ((ddir = opendir(".")) == NULL) {
tst_brkm(TBROK|TERRNO, cleanup, "opendir(.) failed");
- /*NOTREACHED*/}
+ }
filenames[0] = ".";
filenames[1] = "..";
@@ -136,7 +140,7 @@
cleanup();
return 0;
- /*NOTREACHED*/}
+ }
/*
* setup() - performs all ONE TIME setup for this test
diff --git a/testcases/kernel/syscalls/chdir/chdir02.c b/testcases/kernel/syscalls/chdir/chdir02.c
index b7d1fde..49a0bf3 100644
--- a/testcases/kernel/syscalls/chdir/chdir02.c
+++ b/testcases/kernel/syscalls/chdir/chdir02.c
@@ -135,7 +135,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/chdir/chdir03.c b/testcases/kernel/syscalls/chdir/chdir03.c
index f8d8c4e..2341cc5 100644
--- a/testcases/kernel/syscalls/chdir/chdir03.c
+++ b/testcases/kernel/syscalls/chdir/chdir03.c
@@ -88,7 +88,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -165,7 +169,7 @@
cleanup();
return 0;
- /*NOTREACHED*/}
+ }
/*
* setup() - performs all ONE TIME setup for this test.
@@ -176,7 +180,7 @@
/* make sure the process ID is root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root.");
+ tst_brkm(TBROK, NULL, "Test must be run as root.");
}
/* capture signals */
diff --git a/testcases/kernel/syscalls/chdir/chdir04.c b/testcases/kernel/syscalls/chdir/chdir04.c
index c279566..7caee85 100644
--- a/testcases/kernel/syscalls/chdir/chdir04.c
+++ b/testcases/kernel/syscalls/chdir/chdir04.c
@@ -115,7 +115,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -151,7 +155,7 @@
cleanup();
return 0;
- /*NOTREACHED*/}
+ }
/*
* setup() - performs all ONE TIME setup for this test.
diff --git a/testcases/kernel/syscalls/chmod/chmod01.c b/testcases/kernel/syscalls/chmod/chmod01.c
index 7e656cc..4e82b27 100644
--- a/testcases/kernel/syscalls/chmod/chmod01.c
+++ b/testcases/kernel/syscalls/chmod/chmod01.c
@@ -101,7 +101,11 @@
TST_TOTAL = sizeof(Modes) / sizeof(int);
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -170,7 +174,7 @@
cleanup();
return 0;
- /*NOTREACHED*/} /* End main */
+ } /* End main */
/*
* void
diff --git a/testcases/kernel/syscalls/chmod/chmod03.c b/testcases/kernel/syscalls/chmod/chmod03.c
index c93d264..10148c6 100644
--- a/testcases/kernel/syscalls/chmod/chmod03.c
+++ b/testcases/kernel/syscalls/chmod/chmod03.c
@@ -106,7 +106,11 @@
mode_t file_mode; /* mode permissions set on testfile */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -167,7 +171,7 @@
cleanup();
return 0;
- /*NOTREACHED*/} /* End main */
+ } /* End main */
/*
* void
@@ -184,7 +188,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1)
diff --git a/testcases/kernel/syscalls/chmod/chmod04.c b/testcases/kernel/syscalls/chmod/chmod04.c
index 0ebb0cd..6c4f72d 100644
--- a/testcases/kernel/syscalls/chmod/chmod04.c
+++ b/testcases/kernel/syscalls/chmod/chmod04.c
@@ -106,7 +106,11 @@
mode_t dir_mode; /* mode permissions set on testdirectory */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -168,7 +172,7 @@
cleanup();
return 0;
- /*NOTREACHED*/} /* End main */
+ } /* End main */
/*
* void
@@ -183,7 +187,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1)
diff --git a/testcases/kernel/syscalls/chmod/chmod05.c b/testcases/kernel/syscalls/chmod/chmod05.c
index 82ef9b3..0982e11 100644
--- a/testcases/kernel/syscalls/chmod/chmod05.c
+++ b/testcases/kernel/syscalls/chmod/chmod05.c
@@ -125,7 +125,11 @@
mode_t dir_mode; /* mode permissions set on test directory */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -191,7 +195,7 @@
cleanup();
return 0;
- /*NOTREACHED*/} /* End main */
+ } /* End main */
/*
* void
@@ -210,7 +214,7 @@
//wjh Improper comment! This makes sure we _are_ "root" not "nobody"
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* Pause if that option was specified */
diff --git a/testcases/kernel/syscalls/chmod/chmod06.c b/testcases/kernel/syscalls/chmod/chmod06.c
index 7ef0b7d..2ec580d 100644
--- a/testcases/kernel/syscalls/chmod/chmod06.c
+++ b/testcases/kernel/syscalls/chmod/chmod06.c
@@ -109,8 +109,6 @@
int setup3(); /* setup function to test chmod for ENOTDIR */
int longpath_setup(); /* setup function to test chmod for ENAMETOOLONG */
-char *get_high_address(); /* Function from ltp-Lib */
-
char *test_home; /* variable to hold TESTHOME env. */
char Longpathname[PATH_MAX + 2];
char High_address_node[64];
@@ -160,7 +158,11 @@
struct passwd *ltpuser;
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -232,7 +234,7 @@
cleanup();
return 0;
- /*NOTREACHED*/} /* End main */
+ } /* End main */
/*
* void
@@ -253,7 +255,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* Pause if that option was specified */
diff --git a/testcases/kernel/syscalls/chmod/chmod07.c b/testcases/kernel/syscalls/chmod/chmod07.c
index 9738140..d67d23a 100644
--- a/testcases/kernel/syscalls/chmod/chmod07.c
+++ b/testcases/kernel/syscalls/chmod/chmod07.c
@@ -106,7 +106,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -165,7 +169,7 @@
cleanup();
return 0;
- /*NOTREACHED*/} /* End main */
+ } /* End main */
/*
* void
diff --git a/testcases/kernel/syscalls/chown/chown01.c b/testcases/kernel/syscalls/chown/chown01.c
index ce48657..7134333 100644
--- a/testcases/kernel/syscalls/chown/chown01.c
+++ b/testcases/kernel/syscalls/chown/chown01.c
@@ -139,7 +139,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/chown/chown02.c b/testcases/kernel/syscalls/chown/chown02.c
index 00dd07b..03324ad 100644
--- a/testcases/kernel/syscalls/chown/chown02.c
+++ b/testcases/kernel/syscalls/chown/chown02.c
@@ -117,14 +117,18 @@
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
int ind; /* counter variable for chmod(2) tests */
- uid_t User_id; /* user id of the user set for testfile */
- gid_t Group_id; /* group id of the user set for testfile */
+ uid_t user_id; /* user id of the user set for testfile */
+ gid_t group_id; /* group id of the user set for testfile */
int test_flag; /* test condition specific flag variable */
char *file_name; /* ptr. for test file name */
char *test_desc; /* test specific message */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -142,15 +146,15 @@
file_name = Test_cases[ind].pathname;
test_desc = Test_cases[ind].desc;
- User_id = Test_cases[ind].user_id;
- Group_id = Test_cases[ind].group_id;
+ user_id = Test_cases[ind].user_id;
+ group_id = Test_cases[ind].group_id;
test_flag = Test_cases[ind].test_flag;
/*
* Call chown(2) with different user id and
* group id (numeric values) to set it on testfile.
*/
- TEST(chown(file_name, User_id, Group_id));
+ TEST(chown(file_name, user_id, group_id));
/* check return code of chown(2) */
if (TEST_RETURN == -1) {
@@ -178,12 +182,12 @@
* Check for expected Ownership ids
* set on testfile.
*/
- if ((stat_buf.st_uid != User_id) ||
- (stat_buf.st_gid != Group_id)) {
+ if ((stat_buf.st_uid != user_id) ||
+ (stat_buf.st_gid != group_id)) {
tst_brkm(TFAIL, cleanup, "%s: Incorrect"
" ownership set, Expected %d "
"%d", file_name,
- User_id, Group_id);
+ user_id, group_id);
}
/*
@@ -219,7 +223,7 @@
cleanup();
return 0;
- /*NOTREACHED*/} /* End main */
+ } /* End main */
/*
* void
diff --git a/testcases/kernel/syscalls/chown/chown03.c b/testcases/kernel/syscalls/chown/chown03.c
index cd0f724..19ebb4c 100644
--- a/testcases/kernel/syscalls/chown/chown03.c
+++ b/testcases/kernel/syscalls/chown/chown03.c
@@ -101,11 +101,15 @@
struct stat stat_buf; /* stat(2) struct contents */
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
- uid_t User_id; /* Owner id of the test file. */
- gid_t Group_id; /* Group id of the test file. */
+ uid_t user_id; /* Owner id of the test file. */
+ gid_t group_id; /* Group id of the test file. */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -120,15 +124,15 @@
Tst_count = 0;
/* Get the euid/egid of the process */
- User_id = geteuid();
- Group_id = getegid();
+ user_id = geteuid();
+ group_id = getegid();
/*
* Call chown(2) with different user id and
* group id (numeric values) to set it on testfile.
*/
- TEST(chown(TESTFILE, -1, Group_id));
+ TEST(chown(TESTFILE, -1, group_id));
/* check return code of chown(2) */
if (TEST_RETURN == -1) {
@@ -153,12 +157,12 @@
/*
* Check for expected Ownership ids set on testfile.
*/
- if ((stat_buf.st_uid != User_id) ||
- (stat_buf.st_gid != Group_id)) {
+ if ((stat_buf.st_uid != user_id) ||
+ (stat_buf.st_gid != group_id)) {
tst_resm(TFAIL, "%s: Incorrect ownership"
"set to %d %d, Expected %d %d",
TESTFILE, stat_buf.st_uid,
- stat_buf.st_gid, User_id, Group_id);
+ stat_buf.st_gid, user_id, group_id);
}
/*
@@ -183,7 +187,7 @@
cleanup();
return 0;
-/*NOTREACHED*/
+
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/chown/chown04.c b/testcases/kernel/syscalls/chown/chown04.c
index bed3c41..c32f0dc 100644
--- a/testcases/kernel/syscalls/chown/chown04.c
+++ b/testcases/kernel/syscalls/chown/chown04.c
@@ -149,11 +149,15 @@
char *file_name; /* ptr. for file name whose mode is modified */
char *test_desc; /* test specific error message */
int ind; /* counter to test different test conditions */
- uid_t User_id; /* Effective user id of a test process */
- gid_t Group_id; /* Effective group id of a test process */
+ uid_t user_id; /* Effective user id of a test process */
+ gid_t group_id; /* Effective group id of a test process */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -169,8 +173,8 @@
TEST_EXP_ENOS(exp_enos);
/* Set uid/gid values to that of test process */
- User_id = geteuid();
- Group_id = getegid();
+ user_id = geteuid();
+ group_id = getegid();
/* Check looping state if -c option given */
for (lc = 0; TEST_LOOPING(lc); lc++) {
@@ -190,7 +194,7 @@
* verify that it fails with -1 return value and
* sets appropriate errno.
*/
- TEST(chown(file_name, User_id, Group_id));
+ TEST(chown(file_name, user_id, group_id));
/* Check return code from chown(2) */
if (TEST_RETURN != -1) {
@@ -221,7 +225,7 @@
cleanup();
return 0;
-/*NOTREACHED*/
+
} /* End main */
/*
@@ -245,7 +249,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (seteuid(ltpuser->pw_uid) == -1)
diff --git a/testcases/kernel/syscalls/chown/chown05.c b/testcases/kernel/syscalls/chown/chown05.c
index 0fbeaec..1252abe 100644
--- a/testcases/kernel/syscalls/chown/chown05.c
+++ b/testcases/kernel/syscalls/chown/chown05.c
@@ -108,12 +108,16 @@
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
int ind; /* counter variable for chmod(2) tests */
- uid_t User_id; /* user id of the user set for testfile */
- gid_t Group_id; /* group id of the user set for testfile */
+ uid_t user_id; /* user id of the user set for testfile */
+ gid_t group_id; /* group id of the user set for testfile */
char *test_desc; /* test specific message */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -129,15 +133,15 @@
for (ind = 0; Test_cases[ind].desc != NULL; ind++) {
test_desc = Test_cases[ind].desc;
- User_id = Test_cases[ind].user_id;
- Group_id = Test_cases[ind].group_id;
+ user_id = Test_cases[ind].user_id;
+ group_id = Test_cases[ind].group_id;
/*
* Call chwon(2) with different user id and
* group id (numeric values) to set it on
* testfile.
*/
- TEST(chown(TESTFILE, User_id, Group_id));
+ TEST(chown(TESTFILE, user_id, group_id));
/* check return code of chown(2) */
if (TEST_RETURN == -1) {
@@ -160,23 +164,23 @@
"%s failed, errno:%d",
TESTFILE, TEST_ERRNO);
}
- if (User_id == -1) {
- User_id = Test_cases[ind - 1].user_id;
+ if (user_id == -1) {
+ user_id = Test_cases[ind - 1].user_id;
}
- if (Group_id == -1) {
- Group_id = Test_cases[ind - 1].group_id;
+ if (group_id == -1) {
+ group_id = Test_cases[ind - 1].group_id;
}
/*
* Check for expected Ownership ids
* set on testfile.
*/
- if ((stat_buf.st_uid != User_id) ||
- (stat_buf.st_gid != Group_id)) {
+ if ((stat_buf.st_uid != user_id) ||
+ (stat_buf.st_gid != group_id)) {
tst_resm(TFAIL, "%s: Incorrect "
"ownership set, Expected %d "
- "%d", TESTFILE, User_id,
- Group_id);
+ "%d", TESTFILE, user_id,
+ group_id);
} else {
tst_resm(TPASS,
"chown() succeeds to %s of %s",
@@ -192,7 +196,7 @@
cleanup();
return 0;
- /*NOTREACHED*/} /* End main */
+ } /* End main */
/*
* void
diff --git a/testcases/kernel/syscalls/chroot/chroot01.c b/testcases/kernel/syscalls/chroot/chroot01.c
index a90e3c0..a46837b 100644
--- a/testcases/kernel/syscalls/chroot/chroot01.c
+++ b/testcases/kernel/syscalls/chroot/chroot01.c
@@ -70,7 +70,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -99,7 +103,7 @@
cleanup();
return 0;
- /*NOTREACHED*/}
+ }
/*
* setup() - performs all ONE TIME setup for this test.
@@ -109,7 +113,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (seteuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/chroot/chroot02.c b/testcases/kernel/syscalls/chroot/chroot02.c
index 9cb2928..6d76552 100644
--- a/testcases/kernel/syscalls/chroot/chroot02.c
+++ b/testcases/kernel/syscalls/chroot/chroot02.c
@@ -74,7 +74,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -125,7 +129,7 @@
cleanup();
return 0;
- /*NOTREACHED*/}
+ }
/*
* setup() - performs all ONE TIME setup for this test.
diff --git a/testcases/kernel/syscalls/chroot/chroot03.c b/testcases/kernel/syscalls/chroot/chroot03.c
index a4bf087..c503df5 100644
--- a/testcases/kernel/syscalls/chroot/chroot03.c
+++ b/testcases/kernel/syscalls/chroot/chroot03.c
@@ -125,7 +125,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -164,7 +168,7 @@
cleanup();
return 0;
- /*NOTREACHED*/}
+ }
/*
* setup() - performs all ONE TIME setup for this test.
diff --git a/testcases/kernel/syscalls/chroot/chroot04.c b/testcases/kernel/syscalls/chroot/chroot04.c
index 1ab612e..1fe336d 100644
--- a/testcases/kernel/syscalls/chroot/chroot04.c
+++ b/testcases/kernel/syscalls/chroot/chroot04.c
@@ -70,7 +70,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -100,7 +104,7 @@
cleanup();
return 0;
- /*NOTREACHED*/}
+ }
/*
* setup() - performs all ONE TIME setup for this test.
@@ -132,12 +136,12 @@
tst_resm(TFAIL, "mkdir() failed to create"
" a testing directory");
exit(1);
- /* NOTREACHED */
+
}
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (seteuid(ltpuser->pw_uid) == -1) {
@@ -162,7 +166,7 @@
tst_resm(TFAIL, "rmdir() failed to removed"
" a testing directory");
exit(1);
- /* NOTREACHED */
+
}
/*
* print timing stats if that option was specified.
diff --git a/testcases/kernel/syscalls/clock_getres/clock_getres01.c b/testcases/kernel/syscalls/clock_getres/clock_getres01.c
index fd1835e..c7f8b04 100644
--- a/testcases/kernel/syscalls/clock_getres/clock_getres01.c
+++ b/testcases/kernel/syscalls/clock_getres/clock_getres01.c
@@ -278,7 +278,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
tst_exit();
}
@@ -297,7 +301,7 @@
break;
default:
usage(progname);
- /* NOTREACHED */
+
}
}
@@ -305,7 +309,7 @@
if (ac != optind) {
tst_resm(TINFO,"Options are not match.");
usage(progname);
- // NOTREACHED
+
}
/*
diff --git a/testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep01.c b/testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep01.c
index fe29f63..9ae9e9b 100644
--- a/testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep01.c
+++ b/testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep01.c
@@ -79,7 +79,7 @@
{
if (sig == SIGINT)
return;
- // NOTREACHED
+
return;
}
@@ -372,6 +372,7 @@
int main(int ac, char **av) {
int result = RESULT_OK;
+<<<<<<< HEAD
int i;
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
@@ -396,6 +397,63 @@
i, (ret == 0) ? "OK" : "NG");
result |= ret;
}
+=======
+ int c;
+ int i;
+ int lc; /* loop counter */
+ char *msg; /* message returned from parse_opts */
+
+ struct option long_options[] = {
+ { "debug", no_argument, 0, 'd' },
+ { "help", no_argument, 0, 'h' },
+ { NULL, 0, NULL, 0 }
+ };
+
+ progname = strchr(av[0], '/');
+ progname = progname ? progname + 1 : av[0];
+
+ /* parse standard options */
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+ tst_exit();
+ }
+
+ setup();
+
+ /* Check looping state if -i option given */
+ for (lc = 0; TEST_LOOPING(lc); ++lc) {
+ Tst_count = 0;
+ for (testno = 0; testno < TST_TOTAL; ++testno) {
+ TEST(c = getopt_long(ac, av, "dh", long_options, NULL));
+ while (TEST_RETURN != -1) {
+ switch (c) {
+ case 'd':
+ opt_debug = 1;
+ break;
+ default:
+ usage(progname);
+
+ }
+ }
+
+
+ if (ac != optind) {
+ tst_resm(TINFO,"Options are not match.");
+ usage(progname);
+
+ }
+
+ /*
+ * Execute test
+ */
+ for (i = 0; i < (int)(sizeof(tcase) / sizeof(tcase[0])); i++) {
+ int ret;
+ tst_resm(TINFO,"(case%02d) START", i);
+ ret = do_test(&tcase[i]);
+ tst_resm(TINFO,"(case%02d) END => %s", i, (ret == 0) ? "OK" : "NG");
+ result |= ret;
+ }
+>>>>>>> master
switch (result) {
case RESULT_OK:
diff --git a/testcases/kernel/syscalls/clock_nanosleep2/clock_nanosleep2_01.c b/testcases/kernel/syscalls/clock_nanosleep2/clock_nanosleep2_01.c
index f48c7b8..9300ba3 100644
--- a/testcases/kernel/syscalls/clock_nanosleep2/clock_nanosleep2_01.c
+++ b/testcases/kernel/syscalls/clock_nanosleep2/clock_nanosleep2_01.c
@@ -126,7 +126,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
tst_exit();
}
diff --git a/testcases/kernel/syscalls/clone/clone01.c b/testcases/kernel/syscalls/clone/clone01.c
index 9a4e72c..b9c71b7 100644
--- a/testcases/kernel/syscalls/clone/clone01.c
+++ b/testcases/kernel/syscalls/clone/clone01.c
@@ -98,9 +98,15 @@
int status, child_pid;
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -142,7 +148,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/clone/clone02.c b/testcases/kernel/syscalls/clone/clone02.c
index 2ae77b4..c313cd8 100644
--- a/testcases/kernel/syscalls/clone/clone02.c
+++ b/testcases/kernel/syscalls/clone/clone02.c
@@ -163,7 +163,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -237,7 +241,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/clone/clone03.c b/testcases/kernel/syscalls/clone/clone03.c
index 5b087f3..367b91c 100644
--- a/testcases/kernel/syscalls/clone/clone03.c
+++ b/testcases/kernel/syscalls/clone/clone03.c
@@ -100,7 +100,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -164,7 +168,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/clone/clone04.c b/testcases/kernel/syscalls/clone/clone04.c
index 3ca8cb7..bfa0cf6 100644
--- a/testcases/kernel/syscalls/clone/clone04.c
+++ b/testcases/kernel/syscalls/clone/clone04.c
@@ -106,9 +106,15 @@
void *test_stack;
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -151,7 +157,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
diff --git a/testcases/kernel/syscalls/clone/clone05.c b/testcases/kernel/syscalls/clone/clone05.c
index 9c7098e..5d40574 100644
--- a/testcases/kernel/syscalls/clone/clone05.c
+++ b/testcases/kernel/syscalls/clone/clone05.c
@@ -97,9 +97,15 @@
void *child_stack; /* stack for child */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -138,7 +144,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/clone/clone06.c b/testcases/kernel/syscalls/clone/clone06.c
index fb73e30..77f8e4f 100644
--- a/testcases/kernel/syscalls/clone/clone06.c
+++ b/testcases/kernel/syscalls/clone/clone06.c
@@ -105,9 +105,15 @@
char buff[MAX_LINE_LENGTH];
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -170,7 +176,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/clone/clone07.c b/testcases/kernel/syscalls/clone/clone07.c
index abc0b25..86ed479 100644
--- a/testcases/kernel/syscalls/clone/clone07.c
+++ b/testcases/kernel/syscalls/clone/clone07.c
@@ -104,9 +104,15 @@
void *child_stack; /* stack for child */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
diff --git a/testcases/kernel/syscalls/close/close01.c b/testcases/kernel/syscalls/close/close01.c
index 6ab8558..84e4ad1 100644
--- a/testcases/kernel/syscalls/close/close01.c
+++ b/testcases/kernel/syscalls/close/close01.c
@@ -95,8 +95,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup(); /* global setup */
@@ -148,7 +152,7 @@
cleanup();
return 0;
- /*NOTREACHED*/}
+ }
/*
* setup() - performs all ONE TIME setup for this test
diff --git a/testcases/kernel/syscalls/close/close02.c b/testcases/kernel/syscalls/close/close02.c
index 5a44b75..465e5bd 100644
--- a/testcases/kernel/syscalls/close/close02.c
+++ b/testcases/kernel/syscalls/close/close02.c
@@ -75,8 +75,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup(); /* global setup */
@@ -108,7 +112,7 @@
cleanup();
return 0;
- /*NOTREACHED*/}
+ }
/*
* setup() - performs all ONE TIME setup for this test
diff --git a/testcases/kernel/syscalls/close/close08.c b/testcases/kernel/syscalls/close/close08.c
index ca3732b..7a4444a 100644
--- a/testcases/kernel/syscalls/close/close08.c
+++ b/testcases/kernel/syscalls/close/close08.c
@@ -138,7 +138,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/connect/connect01.c b/testcases/kernel/syscalls/connect/connect01.c
index 85db92f..819c5b4 100644
--- a/testcases/kernel/syscalls/connect/connect01.c
+++ b/testcases/kernel/syscalls/connect/connect01.c
@@ -128,7 +128,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -171,7 +175,7 @@
cleanup();
return 0;
- /*NOTREACHED*/} /* End main */
+ } /* End main */
pid_t pid;
diff --git a/testcases/kernel/syscalls/creat/creat01.c b/testcases/kernel/syscalls/creat/creat01.c
index 98f7497..a8b15ff 100644
--- a/testcases/kernel/syscalls/creat/creat01.c
+++ b/testcases/kernel/syscalls/creat/creat01.c
@@ -94,7 +94,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* set "tstdir", and "testfile" variables */
@@ -126,7 +130,7 @@
cleanup();
return 0;
- /*NOTREACHED*/}
+ }
/*
* functest1() - check the functionality of the first test by making sure
@@ -151,7 +155,7 @@
if (stat(filename, &buf) < 0) {
tst_brkm(TBROK, cleanup, "failed to stat test file");
- /*NOTREACHED*/}
+ }
if (buf.st_size != 0) {
tst_resm(TFAIL, "creat() FAILED to truncate "
"file to zero bytes");
@@ -167,7 +171,7 @@
{
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1)
diff --git a/testcases/kernel/syscalls/creat/creat03.c b/testcases/kernel/syscalls/creat/creat03.c
index 9ffc076..0a63b8d 100644
--- a/testcases/kernel/syscalls/creat/creat03.c
+++ b/testcases/kernel/syscalls/creat/creat03.c
@@ -70,8 +70,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup();
@@ -86,7 +90,7 @@
if (TEST_RETURN == -1) {
tst_resm(TFAIL, "Cannot creat %s", pfilname);
continue;
- /*NOTREACHED*/}
+ }
if (STD_FUNCTIONAL_TEST) {
if (fstat(TEST_RETURN, &statbuf) == -1) {
@@ -112,7 +116,7 @@
cleanup();
return 0;
- /*NOTREACHED*/}
+ }
/*
* setup() - performs all ONE TIME setup for this test
diff --git a/testcases/kernel/syscalls/creat/creat04.c b/testcases/kernel/syscalls/creat/creat04.c
index 6de10da..620f82f 100644
--- a/testcases/kernel/syscalls/creat/creat04.c
+++ b/testcases/kernel/syscalls/creat/creat04.c
@@ -98,7 +98,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -194,7 +198,7 @@
cleanup();
return 0;
- /*NOTREACHED*/}
+ }
/*
* setup() - performs all ONE TIME setup for this test.
@@ -203,7 +207,7 @@
{
/* The test must be run as root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* capture signals */
diff --git a/testcases/kernel/syscalls/creat/creat05.c b/testcases/kernel/syscalls/creat/creat05.c
index f3dc65b..6ae3ad4 100644
--- a/testcases/kernel/syscalls/creat/creat05.c
+++ b/testcases/kernel/syscalls/creat/creat05.c
@@ -78,7 +78,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -112,7 +116,7 @@
cleanup();
return 0;
- /*NOTREACHED*/}
+ }
/*
* setup() - performs all ONE TIME setup for this test.
@@ -148,7 +152,7 @@
max_open = getdtablesize();
/* Allocate memory for stat and ustat structure variables */
if ((buf = (int *)malloc(sizeof(int) * max_open - first)) == NULL) {
- tst_brkm(TBROK, tst_exit, "Failed to allocate Memory");
+ tst_brkm(TBROK, NULL, "Failed to allocate Memory");
}
/* now open as many files as we can up to max_open */
diff --git a/testcases/kernel/syscalls/creat/creat06.c b/testcases/kernel/syscalls/creat/creat06.c
index 30d5e10..30c3892 100644
--- a/testcases/kernel/syscalls/creat/creat06.c
+++ b/testcases/kernel/syscalls/creat/creat06.c
@@ -135,7 +135,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -172,7 +176,7 @@
return 0;
return 0;
- /*NOTREACHED*/}
+ }
/*
* setup() - performs all ONE TIME setup for this test.
@@ -183,7 +187,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (seteuid(ltpuser->pw_uid) == -1)
diff --git a/testcases/kernel/syscalls/creat/creat07.c b/testcases/kernel/syscalls/creat/creat07.c
index a02d95a..03db086 100644
--- a/testcases/kernel/syscalls/creat/creat07.c
+++ b/testcases/kernel/syscalls/creat/creat07.c
@@ -84,7 +84,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, options, &help)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
if (!Fflag) {
@@ -164,7 +168,7 @@
cleanup();
return 0;
- /*NOTREACHED*/}
+ }
/*
* help() - Prints out the help message for the -F option defined
@@ -198,12 +202,12 @@
path = dname;
else {
if ((pwd = getcwd(NULL, 0)) == NULL) {
- tst_brkm(TBROK, tst_exit,
+ tst_brkm(TBROK, NULL,
"Could not get current directory");
}
path = malloc(strlen(pwd) + strlen(dname) + 2);
if (path == NULL) {
- tst_brkm(TBROK, tst_exit, "Cannot alloc path string");
+ tst_brkm(TBROK, NULL, "Cannot alloc path string");
}
sprintf(path, "%s/%s", pwd, dname);
}
@@ -215,14 +219,14 @@
*/
cmd = malloc(strlen(path) + strlen(bname) + 15);
if (cmd == NULL) {
- tst_brkm(TBROK, tst_exit, "Cannot alloc command string");
+ tst_brkm(TBROK, NULL, "Cannot alloc command string");
}
sprintf(cmd, "cp -p %s/%s .", path, bname);
res = system(cmd);
free(cmd);
if (res == -1) {
- tst_brkm(TBROK, tst_exit, "Cannot copy file %s", fname);
+ tst_brkm(TBROK, NULL, "Cannot copy file %s", fname);
}
fname = bname;
diff --git a/testcases/kernel/syscalls/creat/creat08.c b/testcases/kernel/syscalls/creat/creat08.c
index 4a7bbad..cc502d7 100644
--- a/testcases/kernel/syscalls/creat/creat08.c
+++ b/testcases/kernel/syscalls/creat/creat08.c
@@ -97,7 +97,7 @@
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
tst_resm(TBROK, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
if (issu() != 0) {
tst_resm(TINFO, "Must be root to run this test.");
diff --git a/testcases/kernel/syscalls/creat/creat09.c b/testcases/kernel/syscalls/creat/creat09.c
index b02f1a4..a96ef11 100644
--- a/testcases/kernel/syscalls/creat/creat09.c
+++ b/testcases/kernel/syscalls/creat/creat09.c
@@ -138,7 +138,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/dup/dup06.c b/testcases/kernel/syscalls/dup/dup06.c
index 46ee87f..2a884e0 100644
--- a/testcases/kernel/syscalls/dup/dup06.c
+++ b/testcases/kernel/syscalls/dup/dup06.c
@@ -77,7 +77,7 @@
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
tst_resm(TBROK, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
/* pick up the nofiles */
min = getdtablesize();
diff --git a/testcases/kernel/syscalls/dup/dup07.c b/testcases/kernel/syscalls/dup/dup07.c
index 5e14457..e16b6b4 100644
--- a/testcases/kernel/syscalls/dup/dup07.c
+++ b/testcases/kernel/syscalls/dup/dup07.c
@@ -70,7 +70,7 @@
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
tst_resm(TBROK, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
local_flag = PASSED;
diff --git a/testcases/kernel/syscalls/dup2/dup201.c b/testcases/kernel/syscalls/dup2/dup201.c
index f59377f..55b6305 100644
--- a/testcases/kernel/syscalls/dup2/dup201.c
+++ b/testcases/kernel/syscalls/dup2/dup201.c
@@ -110,7 +110,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -160,7 +164,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/dup2/dup202.c b/testcases/kernel/syscalls/dup2/dup202.c
index 3e8cc77..f7d0479 100644
--- a/testcases/kernel/syscalls/dup2/dup202.c
+++ b/testcases/kernel/syscalls/dup2/dup202.c
@@ -158,7 +158,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/dup2/dup203.c b/testcases/kernel/syscalls/dup2/dup203.c
index c1516b1..363f5d6 100644
--- a/testcases/kernel/syscalls/dup2/dup203.c
+++ b/testcases/kernel/syscalls/dup2/dup203.c
@@ -69,7 +69,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -90,31 +94,31 @@
if ((fd0 = creat(filename0, 0666)) == -1) {
tst_brkm(TBROK, cleanup, "cannot create first file");
- /*NOTREACHED*/}
+ }
if (write(fd0, filename0, strlen(filename0)) == -1) {
tst_brkm(TBROK, cleanup, "filename0: write(2) failed");
- /*NOTREACHED*/}
+ }
if ((fd1 = creat(filename1, 0666)) == -1) {
tst_brkm(TBROK, cleanup, "Cannot create second file");
- /*NOTREACHED*/}
+ }
if (write(fd1, filename1, strlen(filename1)) == -1) {
tst_brkm(TBROK, cleanup, "filename1: write(2) failed");
- /*NOTREACHED*/}
+ }
if (close(fd0) == -1) {
tst_brkm(TBROK, cleanup, "close(2) fd0 failed");
- /*NOTREACHED*/}
+ }
if ((fd0 = open(filename0, O_RDONLY)) == -1) {
tst_brkm(TBROK, cleanup, "open(2) on filename0 failed");
- /*NOTREACHED*/}
+ }
if (close(fd1) == -1) {
tst_brkm(TBROK, cleanup, "close(2) fd1 failed");
- /*NOTREACHED*/}
+ }
if ((fd1 = open(filename1, O_RDONLY)) == -1) {
tst_brkm(TBROK, cleanup, "open(2) on filename1 failed");
- /*NOTREACHED*/}
+ }
TEST(dup2(fd0, fd1));
@@ -129,7 +133,7 @@
memset(buf, 0, sizeof(buf));
if (read(fd2, buf, sizeof(buf)) == -1) {
tst_brkm(TBROK, cleanup, "read(2) failed");
- /*NOTREACHED*/}
+ }
if (strcmp(buf, filename0) != 0) {
tst_resm(TFAIL, "read from file got bad data");
}
@@ -155,19 +159,19 @@
if ((fd0 = creat(filename0, 0666)) == -1) {
tst_brkm(TBROK, cleanup, "Cannot create first file");
- /*NOTREACHED*/}
+ }
if (fcntl(fd0, F_SETFD, 1) == -1) {
tst_brkm(TBROK, cleanup, "setting close on exec flag "
"on fd0 failed");
- /*NOTREACHED*/}
+ }
if ((fd2 = creat(filename1, 0666)) == -1) {
tst_brkm(TBROK, cleanup, "Cannot create second file");
- /*NOTREACHED*/}
+ }
if (close(fd2) == -1) {
tst_brkm(TBROK, cleanup, "close(2) fd_closed failed");
- /*NOTREACHED*/}
+ }
TEST(dup2(fd0, fd2));
@@ -183,11 +187,11 @@
tst_resm(TFAIL, "fcntl F_GETFD on fd1 failed - "
"Expected rval of 0, got %d", rval);
break;
- /*NOTREACHED*/}
+ }
if (!((rval = fcntl(fd0, F_GETFL, 0)) && O_WRONLY)) {
tst_resm(TFAIL, "fctnl F_GETFL bad rval on fd0 "
"Expected 1 got %#x", rval);
- /*NOTREACHED*/}
+ }
tst_resm(TPASS, "dup2 test 2 functionality is correct");
} else {
tst_resm(TPASS, "call succeeded");
@@ -201,7 +205,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/dup2/dup204.c b/testcases/kernel/syscalls/dup2/dup204.c
index 246edf9..aadfdb4 100644
--- a/testcases/kernel/syscalls/dup2/dup204.c
+++ b/testcases/kernel/syscalls/dup2/dup204.c
@@ -67,7 +67,11 @@
struct stat oldbuf, newbuf;
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -116,7 +120,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/dup2/dup205.c b/testcases/kernel/syscalls/dup2/dup205.c
index b731d59..9846bac 100644
--- a/testcases/kernel/syscalls/dup2/dup205.c
+++ b/testcases/kernel/syscalls/dup2/dup205.c
@@ -67,7 +67,7 @@
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
tst_resm(TBROK, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
/*--------------------------------------------------------------------*/
local_flag = PASSED;
diff --git a/testcases/kernel/syscalls/dup3/dup3_01.c b/testcases/kernel/syscalls/dup3/dup3_01.c
index f19dc27..4146aaf 100644
--- a/testcases/kernel/syscalls/dup3/dup3_01.c
+++ b/testcases/kernel/syscalls/dup3/dup3_01.c
@@ -73,7 +73,6 @@
/* Global Variables */
char *TCID = "dup3_01"; /* test program identifier. */
-int testno;
int TST_TOTAL = 1; /* total number of tests in this file. */
/* Extern Global Functions */
@@ -99,9 +98,6 @@
/* Remove tmp dir and all files in it */
TEST_CLEANUP;
tst_rmdir();
-
- /* Exit with appropriate return code. */
- tst_exit();
}
/* Local Functions */
@@ -133,66 +129,42 @@
int main(int argc, char *argv[])
{
int fd, coe;
- int lc; /* loop counter */
- char *msg; /* message returned from parse_opts */
- /* Parse standard options given to run the test. */
- msg = parse_opts(argc, argv, NULL, NULL);
- if (msg != NULL) {
- tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
if ((tst_kvercmp(2, 6, 27)) < 0) {
- tst_resm(TCONF,
+ tst_brkm(TCONF, cleanup,
"This test can only run on kernels that are 2.6.27 and higher");
- tst_exit();
}
setup();
- /* Check looping state if -i option given */
- for (lc = 0; TEST_LOOPING(lc); ++lc) {
- Tst_count = 0;
- for (testno = 0; testno < TST_TOTAL; ++testno) {
- fd = syscall(__NR_dup3, 1, 4, 0);
- if (fd == -1) {
- tst_resm(TFAIL, "dup3(0) failed");
- cleanup();
- tst_exit();
- }
- coe = fcntl(fd, F_GETFD);
- if (coe == -1) {
- tst_brkm(TBROK, cleanup, "fcntl failed");
- tst_exit();
- }
- if (coe & FD_CLOEXEC) {
- tst_resm(TFAIL,
- "dup3(0) set close-on-exec flag");
- cleanup();
- tst_exit();
- }
- close(fd);
-
- fd = syscall(__NR_dup3, 1, 4, O_CLOEXEC);
- if (fd == -1) {
- tst_resm(TFAIL, "dup3(O_CLOEXEC) failed");
- cleanup();
- tst_exit();
- }
- coe = fcntl(fd, F_GETFD);
- if (coe == -1) {
- tst_brkm(TBROK, cleanup, "fcntl failed");
- tst_exit();
- }
- if ((coe & FD_CLOEXEC) == 0) {
- tst_resm(TFAIL,
- "dup3(O_CLOEXEC) set close-on-exec flag");
- cleanup();
- tst_exit();
- }
- close(fd);
- tst_resm(TPASS, "dup3(O_CLOEXEC) PASSED");
- cleanup();
- }
+ fd = syscall(__NR_dup3, 1, 4, 0);
+ if (fd == -1) {
+ tst_brkm(TFAIL|TERRNO, cleanup, "dup3(0) failed");
}
+ coe = fcntl(fd, F_GETFD);
+ if (coe == -1) {
+ tst_brkm(TBROK|TERRNO, cleanup, "fcntl failed");
+ }
+ if (coe & FD_CLOEXEC) {
+ tst_brkm(TFAIL, cleanup,
+ "dup3(0) set close-on-exec flag");
+ }
+ close(fd);
+
+ fd = syscall(__NR_dup3, 1, 4, O_CLOEXEC);
+ if (fd == -1) {
+ tst_brkm(TFAIL|TERRNO, cleanup, "dup3(O_CLOEXEC) failed");
+ }
+ coe = fcntl(fd, F_GETFD);
+ if (coe == -1) {
+ tst_brkm(TBROK|TERRNO, cleanup, "fcntl failed");
+ }
+ if ((coe & FD_CLOEXEC) == 0) {
+ tst_brkm(TFAIL, cleanup,
+ "dup3(O_CLOEXEC) set close-on-exec flag");
+ }
+ close(fd);
+ tst_resm(TPASS, "dup3(O_CLOEXEC) PASSED");
+
+ cleanup();
tst_exit();
}
diff --git a/testcases/kernel/syscalls/epoll/epoll-ltp.c b/testcases/kernel/syscalls/epoll/epoll-ltp.c
index dc07fb1..909b226 100644
--- a/testcases/kernel/syscalls/epoll/epoll-ltp.c
+++ b/testcases/kernel/syscalls/epoll/epoll-ltp.c
@@ -220,16 +220,14 @@
num_epoll_create_test_calls++;
epoll_fd = epoll_create(fd_set_size);
if (epoll_fd >= 0) {
- tst_resm(TFAIL,
- "epoll_create with negative set size returned a valid fd (errno = %d:%s)",
- errno, strerror(errno));
+ tst_resm(TFAIL|TERRNO,
+ "epoll_create with negative set size succeeded unexpectedly");
num_epoll_create_test_fails++;
close(epoll_fd);
} else {
if (errno != EINVAL) {
- tst_resm(TFAIL,
- "epoll_create with negative set size failed to set errno to EINVAL (%d:%s)",
- errno, strerror(errno));
+ tst_resm(TFAIL|TERRNO,
+ "epoll_create with negative set size didn't set errno to EINVAL");
num_epoll_create_test_fails++;
} else {
tst_resm(TPASS, "epoll_create with negative set size");
@@ -618,7 +616,7 @@
/* Now test the result */
if (!((result == RES_PASS)
|| (result == RES_PASS_RETV_MAT_ERRNO_IGN))) {
- if (result > sizeof(result_strings) / sizeof(const char *)) {
+ if (result > (sizeof(result_strings) / sizeof(const char *))) {
/* Returned a result which has no corresponding text description */
EPOLL_CTL_TEST_FAIL
("FIXME FIX ME BUG in Test Program itself!");
@@ -660,8 +658,7 @@
/* Get the current time */
if (gettimeofday(&tv, NULL) != 0) {
- tst_brkm(TBROK, NULL, "gettimeofday failed");
- tst_exit();
+ tst_brkm(TBROK|TERRNO, NULL, "gettimeofday failed");
} else {
tst_resm(TINFO, "gettimeofday() works");
}
@@ -680,7 +677,7 @@
/* Create an epoll_fd for testing epoll_ctl */
epoll_fd = epoll_create(BACKING_STORE_SIZE_HINT);
if (epoll_fd < 0) {
- return -1;
+ tst_brkm(TFAIL|TERRNO, NULL, "epoll_create failed");
}
tst_resm(TINFO, "Testing epoll_ctl");
@@ -689,15 +686,14 @@
/* ctl test(s) failed */
}
- return 0;
+ tst_exit();
}
#else
int main(void)
{
- tst_resm(TCONF, "No epoll support found.");
- tst_exit();
+ tst_brkm(TCONF, NULL, "No epoll support found.");
}
#endif
diff --git a/testcases/kernel/syscalls/epoll_create1/epoll_create1_01.c b/testcases/kernel/syscalls/epoll_create1/epoll_create1_01.c
index 601376f..e8e0f5c 100644
--- a/testcases/kernel/syscalls/epoll_create1/epoll_create1_01.c
+++ b/testcases/kernel/syscalls/epoll_create1/epoll_create1_01.c
@@ -77,7 +77,6 @@
/* Global Variables */
char *TCID = "epoll_create1_01"; /* test program identifier. */
-int testno;
int TST_TOTAL = 1; /* total number of tests in this file. */
/* Extern Global Functions */
@@ -103,9 +102,6 @@
/* Remove tmp dir and all files in it */
TEST_CLEANUP;
tst_rmdir();
-
- /* Exit with appropriate return code. */
- tst_exit();
}
/* Local Functions */
@@ -137,66 +133,44 @@
int main(int argc, char *argv[])
{
int fd, coe;
- int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
- /* Parse standard options given to run the test. */
- msg = parse_opts(argc, argv, NULL, NULL);
- if (msg != NULL) {
- tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
if ((tst_kvercmp(2, 6, 27)) < 0) {
- tst_resm(TCONF,
+ tst_brkm(TCONF, NULL,
"This test can only run on kernels that are 2.6.27 and higher");
- tst_exit();
}
setup();
/* Check looping state if -i option given */
- for (lc = 0; TEST_LOOPING(lc); ++lc) {
- Tst_count = 0;
- for (testno = 0; testno < TST_TOTAL; ++testno) {
- fd = syscall(__NR_epoll_create1, 0);
- if (fd == -1) {
- tst_resm(TFAIL, "epoll_create1(0) failed");
- cleanup();
- tst_exit();
- }
- coe = fcntl(fd, F_GETFD);
- if (coe == -1) {
- tst_brkm(TBROK, cleanup, "fcntl failed");
- tst_exit();
- }
- if (coe & FD_CLOEXEC) {
- tst_resm(TFAIL,
- "epoll_create1(0) set close-on-exec flag");
- cleanup();
- tst_exit();
- }
- close(fd);
- fd = syscall(__NR_epoll_create1, EPOLL_CLOEXEC);
- if (fd == -1) {
- tst_resm(TFAIL,
- "epoll_create1(EPOLL_CLOEXEC) failed");
- cleanup();
- tst_exit();
- }
- coe = fcntl(fd, F_GETFD);
- if (coe == -1) {
- tst_brkm(TBROK, cleanup, "fcntl failed");
- tst_exit();
- }
- if ((coe & FD_CLOEXEC) == 0) {
- tst_resm(TFAIL,
- "epoll_create1(EPOLL_CLOEXEC) set close-on-exec flag");
- cleanup();
- tst_exit();
- }
- close(fd);
- tst_resm(TPASS, "epoll_create1(EPOLL_CLOEXEC) PASSED");
- cleanup();
- }
+ fd = syscall(__NR_epoll_create1, 0);
+ if (fd == -1) {
+ tst_brkm(TFAIL, cleanup, "epoll_create1(0) failed");
}
+ coe = fcntl(fd, F_GETFD);
+ if (coe == -1) {
+ tst_brkm(TBROK, cleanup, "fcntl failed");
+ }
+ if (coe & FD_CLOEXEC) {
+ tst_brkm(TFAIL, cleanup,
+ "epoll_create1(0) set close-on-exec flag");
+ }
+ close(fd);
+ fd = syscall(__NR_epoll_create1, EPOLL_CLOEXEC);
+ if (fd == -1) {
+ tst_brkm(TFAIL, cleanup,
+ "epoll_create1(EPOLL_CLOEXEC) failed");
+ }
+ coe = fcntl(fd, F_GETFD);
+ if (coe == -1) {
+ tst_brkm(TBROK, cleanup, "fcntl failed");
+ }
+ if ((coe & FD_CLOEXEC) == 0) {
+ tst_brkm(TFAIL, cleanup,
+ "epoll_create1(EPOLL_CLOEXEC) set close-on-exec flag");
+ }
+ close(fd);
+ tst_resm(TPASS, "epoll_create1(EPOLL_CLOEXEC) PASSED");
+
+ cleanup();
tst_exit();
}
diff --git a/testcases/kernel/syscalls/eventfd/eventfd01.c b/testcases/kernel/syscalls/eventfd/eventfd01.c
index 4135481..ab4eb5a 100644
--- a/testcases/kernel/syscalls/eventfd/eventfd01.c
+++ b/testcases/kernel/syscalls/eventfd/eventfd01.c
@@ -675,7 +675,7 @@
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /* NOTREACHED */
+
}
setup();
@@ -729,7 +729,7 @@
tst_sig(FORK, DEF_HANDLER, cleanup);
if (tst_kvercmp(2, 6, 22) < 0)
- tst_brkm(TCONF, tst_exit, "2.6.22 or greater kernel required");
+ tst_brkm(TCONF, NULL, "2.6.22 or greater kernel required");
/* Create a temporary directory & chdir there */
tst_tmpdir();
diff --git a/testcases/kernel/syscalls/eventfd2/eventfd2_01.c b/testcases/kernel/syscalls/eventfd2/eventfd2_01.c
index f04ec57..059d345 100644
--- a/testcases/kernel/syscalls/eventfd2/eventfd2_01.c
+++ b/testcases/kernel/syscalls/eventfd2/eventfd2_01.c
@@ -102,9 +102,6 @@
/* Remove tmp dir and all files in it */
TEST_CLEANUP;
tst_rmdir();
-
- /* Exit with appropriate return code. */
- tst_exit();
}
/* Local Functions */
@@ -136,66 +133,40 @@
int main(int argc, char *argv[])
{
int fd, coe;
- int lc; /* loop counter */
- char *msg; /* message returned from parse_opts */
- /* Parse standard options given to run the test. */
- msg = parse_opts(argc, argv, NULL, NULL);
- if (msg != NULL) {
- tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
if ((tst_kvercmp(2, 6, 27)) < 0) {
- tst_resm(TCONF,
- "This test can only run on kernels that are 2.6.27 and higher");
- tst_exit();
+ tst_brkm(TCONF, cleanup,
+ "This test can only run on kernels that are 2.6.27 and higher");
}
setup();
- /* Check looping state if -i option given */
- for (lc = 0; TEST_LOOPING(lc); ++lc) {
- Tst_count = 0;
- for (testno = 0; testno < TST_TOTAL; ++testno) {
- fd = syscall(__NR_eventfd2, 1, 0);
- if (fd == -1) {
- tst_resm(TFAIL, "eventfd2(0) failed");
- cleanup();
- tst_exit();
- }
- coe = fcntl(fd, F_GETFD);
- if (coe == -1) {
- tst_brkm(TBROK, cleanup, "fcntl failed");
- tst_exit();
- }
- if (coe & FD_CLOEXEC) {
- tst_resm(TFAIL,
- "eventfd2(0) set close-on-exec flag");
- cleanup();
- tst_exit();
- }
- close(fd);
-
- fd = syscall(__NR_eventfd2, 1, EFD_CLOEXEC);
- if (fd == -1) {
- tst_resm(TFAIL, "eventfd2(EFD_CLOEXEC) failed");
- cleanup();
- tst_exit();
- }
- coe = fcntl(fd, F_GETFD);
- if (coe == -1) {
- tst_brkm(TBROK, cleanup, "fcntl failed");
- tst_exit();
- }
- if ((coe & FD_CLOEXEC) == 0) {
- tst_resm(TFAIL,
- "eventfd2(EFD_CLOEXEC) does not set close-on-exec flag");
- cleanup();
- tst_exit();
- }
- close(fd);
- tst_resm(TPASS, "eventfd2(EFD_CLOEXEC) Passed");
- cleanup();
- }
+ fd = syscall(__NR_eventfd2, 1, 0);
+ if (fd == -1) {
+ tst_brkm(TFAIL, cleanup, "eventfd2(0) failed");
}
+ coe = fcntl(fd, F_GETFD);
+ if (coe == -1) {
+ tst_brkm(TBROK, cleanup, "fcntl failed");
+ }
+ if (coe & FD_CLOEXEC) {
+ tst_brkm(TFAIL, cleanup, "eventfd2(0) set close-on-exec flag");
+ }
+ close(fd);
+
+ fd = syscall(__NR_eventfd2, 1, EFD_CLOEXEC);
+ if (fd == -1) {
+ tst_brkm(TFAIL, cleanup, "eventfd2(EFD_CLOEXEC) failed");
+ }
+ coe = fcntl(fd, F_GETFD);
+ if (coe == -1) {
+ tst_brkm(TBROK, cleanup, "fcntl failed");
+ }
+ if ((coe & FD_CLOEXEC) == 0) {
+ tst_brkm(TFAIL, cleanup,
+ "eventfd2(EFD_CLOEXEC) does not set close-on-exec flag");
+ }
+ close(fd);
+ tst_resm(TPASS, "eventfd2(EFD_CLOEXEC) Passed");
+ cleanup();
tst_exit();
}
diff --git a/testcases/kernel/syscalls/eventfd2/eventfd2_02.c b/testcases/kernel/syscalls/eventfd2/eventfd2_02.c
index 16ca383..5fb5259 100644
--- a/testcases/kernel/syscalls/eventfd2/eventfd2_02.c
+++ b/testcases/kernel/syscalls/eventfd2/eventfd2_02.c
@@ -99,9 +99,6 @@
/* Remove tmp dir and all files in it */
TEST_CLEANUP;
tst_rmdir();
-
- /* Exit with appropriate return code. */
- tst_exit();
}
/* Local Functions */
@@ -133,67 +130,43 @@
int main(int argc, char *argv[])
{
int fd, fl;
- int lc; /* loop counter */
- char *msg; /* message returned from parse_opts */
- /* Parse standard options given to run the test. */
- msg = parse_opts(argc, argv, NULL, NULL);
- if (msg != NULL) {
- tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
if ((tst_kvercmp(2, 6, 27)) < 0) {
- tst_resm(TCONF,
- "This test can only run on kernels that are 2.6.27 and higher");
- tst_exit();
+ tst_brkm(TCONF, NULL,
+ "This test can only run on kernels that are 2.6.27 and higher");
}
setup();
- /* Check looping state if -i option given */
- for (lc = 0; TEST_LOOPING(lc); ++lc) {
- Tst_count = 0;
- for (testno = 0; testno < TST_TOTAL; ++testno) {
- fd = syscall(__NR_eventfd2, 1, 0);
- if (fd == -1) {
- tst_resm(TFAIL, "eventfd2(0) failed");
- cleanup();
- tst_exit();
- }
- fl = fcntl(fd, F_GETFL);
- if (fl == -1) {
- tst_brkm(TBROK, cleanup, "fcntl failed");
- tst_exit();
- }
- if (fl & O_NONBLOCK) {
- tst_resm(TFAIL,
- "eventfd2(0) sets non-blocking mode");
- cleanup();
- tst_exit();
- }
- close(fd);
-
- fd = syscall(__NR_eventfd2, 1, EFD_NONBLOCK);
- if (fd == -1) {
- tst_resm(TFAIL,
- "eventfd2(EFD_NONBLOCK) failed");
- cleanup();
- tst_exit();
- }
- fl = fcntl(fd, F_GETFL);
- if (fl == -1) {
- tst_brkm(TBROK, cleanup, "fcntl failed");
- tst_exit();
- }
- if ((fl & O_NONBLOCK) == 0) {
- tst_resm(TFAIL,
- "eventfd2(EFD_NONBLOCK) does not set non-blocking mode");
- cleanup();
- tst_exit();
- }
- close(fd);
- tst_resm(TPASS, "eventfd2(EFD_NONBLOCK) PASSED");
- cleanup();
- }
+ Tst_count = 0;
+ fd = syscall(__NR_eventfd2, 1, 0);
+ if (fd == -1) {
+ tst_brkm(TFAIL, cleanup, "eventfd2(0) failed");
}
+ fl = fcntl(fd, F_GETFL);
+ if (fl == -1) {
+ tst_brkm(TBROK, cleanup, "fcntl failed");
+ }
+ if (fl & O_NONBLOCK) {
+ tst_brkm(TFAIL, cleanup,
+ "eventfd2(0) sets non-blocking mode");
+ }
+ close(fd);
+
+ fd = syscall(__NR_eventfd2, 1, EFD_NONBLOCK);
+ if (fd == -1) {
+ tst_brkm(TFAIL, cleanup, "eventfd2(EFD_NONBLOCK) failed");
+ }
+ fl = fcntl(fd, F_GETFL);
+ if (fl == -1) {
+ tst_brkm(TBROK, cleanup, "fcntl failed");
+ }
+ if ((fl & O_NONBLOCK) == 0) {
+ tst_brkm(TFAIL, cleanup,
+ "eventfd2(EFD_NONBLOCK) didn't set non-blocking mode");
+ }
+ close(fd);
+ tst_resm(TPASS, "eventfd2(EFD_NONBLOCK) PASSED");
+
+ cleanup();
tst_exit();
}
diff --git a/testcases/kernel/syscalls/execl/execl01.c b/testcases/kernel/syscalls/execl/execl01.c
index 2119745..cd97588 100644
--- a/testcases/kernel/syscalls/execl/execl01.c
+++ b/testcases/kernel/syscalls/execl/execl01.c
@@ -144,7 +144,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/execle/execle01.c b/testcases/kernel/syscalls/execle/execle01.c
index b2ca6b3..e7305a4 100644
--- a/testcases/kernel/syscalls/execle/execle01.c
+++ b/testcases/kernel/syscalls/execle/execle01.c
@@ -145,7 +145,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/execlp/execlp01.c b/testcases/kernel/syscalls/execlp/execlp01.c
index 2e9bae3..6a41247 100644
--- a/testcases/kernel/syscalls/execlp/execlp01.c
+++ b/testcases/kernel/syscalls/execlp/execlp01.c
@@ -144,7 +144,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/execv/execv01.c b/testcases/kernel/syscalls/execv/execv01.c
index 1a36abf..ff6dab3 100644
--- a/testcases/kernel/syscalls/execv/execv01.c
+++ b/testcases/kernel/syscalls/execv/execv01.c
@@ -145,7 +145,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/execve/execve01.c b/testcases/kernel/syscalls/execve/execve01.c
index 8f8674a..efe31ee 100644
--- a/testcases/kernel/syscalls/execve/execve01.c
+++ b/testcases/kernel/syscalls/execve/execve01.c
@@ -146,7 +146,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/execve/execve02.c b/testcases/kernel/syscalls/execve/execve02.c
index a01b3f2..8aa0ce5 100644
--- a/testcases/kernel/syscalls/execve/execve02.c
+++ b/testcases/kernel/syscalls/execve/execve02.c
@@ -95,8 +95,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, options, &help)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
if (!Fflag) {
tst_resm(TWARN, "You must specify a test executable with"
@@ -164,7 +168,7 @@
}
}
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -185,7 +189,7 @@
int res;
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* capture signals */
@@ -207,12 +211,12 @@
path = dname;
else {
if ((pwd = getcwd(NULL, 0)) == NULL) {
- tst_brkm(TBROK, tst_exit,
+ tst_brkm(TBROK, NULL,
"Could not get current directory");
}
path = malloc(strlen(pwd) + strlen(dname) + 2);
if (path == NULL) {
- tst_brkm(TBROK, tst_exit, "Cannot alloc path string");
+ tst_brkm(TBROK, NULL, "Cannot alloc path string");
}
sprintf(path, "%s/%s", pwd, dname);
}
@@ -224,14 +228,14 @@
*/
cmd = malloc(strlen(path) + strlen(bname) + 15);
if (cmd == NULL) {
- tst_brkm(TBROK, tst_exit, "Cannot alloc command string");
+ tst_brkm(TBROK, NULL, "Cannot alloc command string");
}
sprintf(cmd, "cp -p %s/%s .", path, bname);
res = system(cmd);
free(cmd);
if (res == -1) {
- tst_brkm(TBROK, tst_exit, "Cannot copy file %s", fname);
+ tst_brkm(TBROK, NULL, "Cannot copy file %s", fname);
}
fname = bname;
diff --git a/testcases/kernel/syscalls/execve/execve03.c b/testcases/kernel/syscalls/execve/execve03.c
index 6e3f07e..575eb2f 100644
--- a/testcases/kernel/syscalls/execve/execve03.c
+++ b/testcases/kernel/syscalls/execve/execve03.c
@@ -132,7 +132,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -171,7 +175,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
diff --git a/testcases/kernel/syscalls/execve/execve04.c b/testcases/kernel/syscalls/execve/execve04.c
index 1e9b166..729c8fd 100644
--- a/testcases/kernel/syscalls/execve/execve04.c
+++ b/testcases/kernel/syscalls/execve/execve04.c
@@ -101,7 +101,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, options, &help)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child_1, "nS", 1, &test_name);
@@ -199,7 +203,7 @@
}
}
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -235,12 +239,12 @@
path = dname;
else {
if ((pwd = getcwd(NULL, 0)) == NULL) {
- tst_brkm(TBROK, tst_exit,
+ tst_brkm(TBROK, NULL,
"Could not get current directory");
}
path = malloc(strlen(pwd) + strlen(dname) + 2);
if (path == NULL) {
- tst_brkm(TBROK, tst_exit, "Cannot alloc path string");
+ tst_brkm(TBROK, NULL, "Cannot alloc path string");
}
sprintf(path, "%s/%s", pwd, dname);
}
@@ -252,14 +256,14 @@
*/
cmd = malloc(strlen(path) + strlen(bname) + 15);
if (cmd == NULL) {
- tst_brkm(TBROK, tst_exit, "Cannot alloc command string");
+ tst_brkm(TBROK, NULL, "Cannot alloc command string");
}
sprintf(cmd, "cp -p %s/%s .", path, bname);
res = system(cmd);
free(cmd);
if (res == -1) {
- tst_brkm(TBROK, tst_exit, "Cannot copy file %s", test_name);
+ tst_brkm(TBROK, NULL, "Cannot copy file %s", test_name);
}
test_name = bname;
diff --git a/testcases/kernel/syscalls/execve/execve05.c b/testcases/kernel/syscalls/execve/execve05.c
index fffa634..5e9dc56 100644
--- a/testcases/kernel/syscalls/execve/execve05.c
+++ b/testcases/kernel/syscalls/execve/execve05.c
@@ -80,14 +80,18 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup();
if (ac != 5) {
tst_resm(TINFO, "Wrong number of arguments");
usage();
- /*NOTREACHED*/}
+ }
/* check looping state if -i option given */
for (lc = 0; TEST_LOOPING(lc); lc++) {
@@ -207,7 +211,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
diff --git a/testcases/kernel/syscalls/execvp/execvp01.c b/testcases/kernel/syscalls/execvp/execvp01.c
index a323fdb..d81a702 100644
--- a/testcases/kernel/syscalls/execvp/execvp01.c
+++ b/testcases/kernel/syscalls/execvp/execvp01.c
@@ -145,7 +145,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/exit/exit01.c b/testcases/kernel/syscalls/exit/exit01.c
index 37f870b..8221415 100644
--- a/testcases/kernel/syscalls/exit/exit01.c
+++ b/testcases/kernel/syscalls/exit/exit01.c
@@ -63,7 +63,7 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
tst_brkm(TBROK, cleanup, "OPTION PARSIkNG ERROR - %s", msg);
- /*NOTREACHED*/}
+ }
setup(); /* global setup for test */
@@ -126,7 +126,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/exit/exit02.c b/testcases/kernel/syscalls/exit/exit02.c
index f0e8020..cb9ce48 100644
--- a/testcases/kernel/syscalls/exit/exit02.c
+++ b/testcases/kernel/syscalls/exit/exit02.c
@@ -79,8 +79,12 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup(); /* global setup for test */
@@ -178,7 +182,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/exit_group/exit_group01.c b/testcases/kernel/syscalls/exit_group/exit_group01.c
index 3c23ece..9616819 100644
--- a/testcases/kernel/syscalls/exit_group/exit_group01.c
+++ b/testcases/kernel/syscalls/exit_group/exit_group01.c
@@ -79,9 +79,6 @@
/* Remove tmp dir and all files in it */
TEST_CLEANUP;
tst_rmdir();
-
- /* Exit with appropriate return code. */
- tst_exit();
}
/* Local Functions */
@@ -112,45 +109,28 @@
int main(int ac, char **av) {
int status;
pid_t cpid, w;
- int lc; /* loop counter */
- char *msg; /* message returned from parse_opts */
-
- /* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
- tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
setup();
/* Check looping state if -i option given */
- for (lc = 0; TEST_LOOPING(lc); ++lc) {
- Tst_count = 0;
- for (testno = 0; testno < TST_TOTAL; ++testno) {
-
- TEST(cpid = fork()); //call exit_group()
- if (TEST_RETURN == -1) {
- tst_resm(TFAIL, "fork() error ...errno %d",TEST_ERRNO);
- cleanup();
- tst_exit();
- } else if (TEST_RETURN == 0) {
- tst_resm(TINFO, "In the child process");
- sleep(5);
- TEST(syscall(__NR_exit_group,4));
- }else {
- tst_resm(TINFO,"in the parent process");
- TEST(w = wait(&status));
- if (WIFEXITED(status) && (WEXITSTATUS(status) == 4)) {
- tst_resm(TPASS,"exit_group call Succeed");
- cleanup();
- }
- }
- tst_resm(TFAIL, "%s failed - errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO));
- cleanup();
- tst_exit();
-
+ cpid = fork(); //call exit_group()
+ if (cpid == -1) {
+ tst_brkm(TFAIL|TERRNO, cleanup, "fork failed");
+ } else if (TEST_RETURN == 0) {
+ sleep(5);
+ TEST(syscall(__NR_exit_group,4));
+ } else {
+ w = wait(&status);
+ if (w == -1)
+ tst_brkm(TBROK|TERRNO, cleanup, "wait failed");
+ if (WIFEXITED(status) && (WEXITSTATUS(status) == 4))
+ tst_resm(TPASS, "exit_group succeeded");
+ else {
+ tst_resm(TFAIL|TERRNO,
+ "exit_group failed (wait status = %d)", w);
}
}
+ cleanup();
tst_exit();
}
diff --git a/testcases/kernel/syscalls/faccessat/faccessat01.c b/testcases/kernel/syscalls/faccessat/faccessat01.c
index 9cb276c..907dd16 100644
--- a/testcases/kernel/syscalls/faccessat/faccessat01.c
+++ b/testcases/kernel/syscalls/faccessat/faccessat01.c
@@ -99,7 +99,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise01.c b/testcases/kernel/syscalls/fadvise/posix_fadvise01.c
index 06edfac..a040903 100644
--- a/testcases/kernel/syscalls/fadvise/posix_fadvise01.c
+++ b/testcases/kernel/syscalls/fadvise/posix_fadvise01.c
@@ -96,7 +96,11 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/*
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise02.c b/testcases/kernel/syscalls/fadvise/posix_fadvise02.c
index d5f14a7..311175d 100644
--- a/testcases/kernel/syscalls/fadvise/posix_fadvise02.c
+++ b/testcases/kernel/syscalls/fadvise/posix_fadvise02.c
@@ -96,7 +96,11 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/*
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise03.c b/testcases/kernel/syscalls/fadvise/posix_fadvise03.c
index 35680aa..92f3e92 100644
--- a/testcases/kernel/syscalls/fadvise/posix_fadvise03.c
+++ b/testcases/kernel/syscalls/fadvise/posix_fadvise03.c
@@ -116,7 +116,11 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/*
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise04.c b/testcases/kernel/syscalls/fadvise/posix_fadvise04.c
index 6ba6ddd..bfa554c 100644
--- a/testcases/kernel/syscalls/fadvise/posix_fadvise04.c
+++ b/testcases/kernel/syscalls/fadvise/posix_fadvise04.c
@@ -102,7 +102,11 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/*
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fallocate/fallocate01.c b/testcases/kernel/syscalls/fallocate/fallocate01.c
index 000c9e5..f456c33 100644
--- a/testcases/kernel/syscalls/fallocate/fallocate01.c
+++ b/testcases/kernel/syscalls/fallocate/fallocate01.c
@@ -226,7 +226,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/* perform global test setup, call setup() function. */
setup();
diff --git a/testcases/kernel/syscalls/fallocate/fallocate02.c b/testcases/kernel/syscalls/fallocate/fallocate02.c
index b353cc4..74b5787 100644
--- a/testcases/kernel/syscalls/fallocate/fallocate02.c
+++ b/testcases/kernel/syscalls/fallocate/fallocate02.c
@@ -275,7 +275,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/* perform global test setup, call setup() function. */
setup();
diff --git a/testcases/kernel/syscalls/fallocate/fallocate03.c b/testcases/kernel/syscalls/fallocate/fallocate03.c
index 663476d..dcbeada 100644
--- a/testcases/kernel/syscalls/fallocate/fallocate03.c
+++ b/testcases/kernel/syscalls/fallocate/fallocate03.c
@@ -261,7 +261,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/* perform global test setup, call setup() function */
setup();
diff --git a/testcases/kernel/syscalls/fchdir/fchdir01.c b/testcases/kernel/syscalls/fchdir/fchdir01.c
index a5659bc..0a92b28 100644
--- a/testcases/kernel/syscalls/fchdir/fchdir01.c
+++ b/testcases/kernel/syscalls/fchdir/fchdir01.c
@@ -58,9 +58,10 @@
#include "test.h"
#include "usctest.h"
-#include <errno.h>
#include <sys/stat.h>
+#include <errno.h>
#include <fcntl.h>
+#include <libgen.h>
#include <string.h>
void cleanup(void);
@@ -84,9 +85,8 @@
int r_val;
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
setup(); /* global setup */
@@ -98,8 +98,7 @@
/* get the name of the test dirctory */
if ((temp_dir = (getcwd(temp_dir, 0))) == NULL) {
- tst_brkm(TBROK, cleanup, "%s - getcwd() in main() "
- "failed", TCID);
+ tst_brkm(TBROK, cleanup, "getcwd failed");
}
/*
@@ -107,8 +106,7 @@
*/
if ((r_val = mkdir(TEST_DIR, MODES)) == -1) {
- tst_brkm(TBROK, cleanup, "%s - mkdir() in main() "
- "failed", TCID);
+ tst_brkm(TBROK, cleanup, "mkdir failed");
}
if ((fd = open(TEST_DIR, O_RDONLY)) == -1) {
@@ -122,8 +120,7 @@
TEST(fchdir(fd));
if (TEST_RETURN == -1) {
- tst_brkm(TFAIL, cleanup, "%s call failed - errno = %d :"
- " %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO));
+ tst_brkm(TFAIL|TTERRNO, cleanup, "fchdir call failed");
} else {
if (STD_FUNCTIONAL_TEST) {
check_functionality();
@@ -162,8 +159,7 @@
}
cleanup();
-
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -172,35 +168,29 @@
void check_functionality(void)
{
char *buf = NULL;
- char **bufptr = &buf;
char *dir;
/*
* Get the current directory path.
*/
if ((buf = (getcwd(buf, 0))) == NULL) {
- tst_brkm(TBROK, cleanup, "%s - getcwd() in "
- "check_functionality() failed", TCID);
+ tst_brkm(TBROK, cleanup, "getcwd failed");
}
/*
* strip off all but the last directory name in the
* current working directory.
*/
- do {
- if ((dir = strsep(bufptr, "/")) == NULL) {
- tst_brkm(TBROK, cleanup, "%s - strsep() in "
- "check_functionality() failed", TCID);
- }
- } while (*bufptr != NULL);
+ if ((dir = basename(buf)) == NULL)
+ tst_brkm(TBROK, cleanup, "basename failed");
/*
* Make sure we are in the right place.
*/
if (strcmp(TEST_DIR, dir) == 0) {
- tst_resm(TPASS, "%s call succeeded", TCID);
+ tst_resm(TPASS, "fchdir call succeeded");
} else {
- tst_resm(TFAIL, "%s functionality test failed", TCID);
+ tst_resm(TFAIL, "fchdir call failed");
}
}
@@ -233,7 +223,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/fchdir/fchdir02.c b/testcases/kernel/syscalls/fchdir/fchdir02.c
index 5ce8477..cf10a6b 100644
--- a/testcases/kernel/syscalls/fchdir/fchdir02.c
+++ b/testcases/kernel/syscalls/fchdir/fchdir02.c
@@ -76,9 +76,8 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
setup(); /* global setup */
@@ -103,19 +102,17 @@
switch (TEST_ERRNO) {
case EBADF:
- tst_resm(TPASS, "expected failure - errno = %d : %s",
- TEST_ERRNO, strerror(TEST_ERRNO));
+ tst_resm(TPASS, "failed with EBADF");
break;
default:
- tst_brkm(TFAIL, cleanup, "call failed with an "
- "unexpected error - %d : %s", TEST_ERRNO,
- strerror(TEST_ERRNO));
+ tst_brkm(TFAIL|TTERRNO, cleanup,
+ "call failed with an unexpected error");
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -150,7 +147,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/fchdir/fchdir03.c b/testcases/kernel/syscalls/fchdir/fchdir03.c
index a8ce3a3..7f89137 100644
--- a/testcases/kernel/syscalls/fchdir/fchdir03.c
+++ b/testcases/kernel/syscalls/fchdir/fchdir03.c
@@ -90,9 +90,8 @@
int status;
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
setup();
@@ -115,42 +114,47 @@
* TEST call is made.
*/
if (seteuid(ltpuser1->pw_uid) != 0) {
- tst_resm(TINFO, "setreuid failed in child #1");
+ perror("setreuid failed in child #1");
exit(1);
}
if (mkdir(good_dir, 00400) != 0) {
- tst_resm(TINFO, "mkdir failed in child #1");
+ perror("mkdir failed in child #1");
exit(1);
}
if ((fd = open(good_dir, O_RDONLY)) == -1) {
- tst_brkm(TBROK, cleanup,
- "open of directory failed");
+ perror("opening directory failed");
}
TEST(fchdir(fd));
if (TEST_RETURN != -1) {
- tst_resm(TFAIL, "call succeeded unexpectedly");
+ printf("Call succeeded unexpectedly\n");
+ exit(1);
} else if (TEST_ERRNO != EACCES) {
- tst_resm(TFAIL, "expected EACCES - got %d",
- TEST_ERRNO);
+ printf("Expected %d - got %d\n",
+ EACCES, TEST_ERRNO);
+ exit(1);
} else {
TEST_ERROR_LOG(TEST_ERRNO);
- tst_resm(TPASS, "expected failure - errno = %d"
- " : %s", TEST_ERRNO,
- strerror(TEST_ERRNO));
+ printf("Got EACCES\n");
}
/* reset the process ID to the saved ID (root) */
if (setuid(0) == -1) {
- tst_resm(TINFO, "setuid(0) failed");
+ perror("setuid(0) failed");
}
- } else { /* parent */
- wait(&status);
-
- /* let the child carry on */
- exit(0);
+ } else {
+ if (wait(&status) == -1)
+ tst_brkm(TBROK|TERRNO, cleanup, "wait failed");
+ else if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
+ tst_brkm(TBROK, cleanup,
+ "child exited abnormally (wait status = "
+ "%d", status);
+ else {
+ /* let the child carry on */
+ exit(0);
+ }
}
/* clean up things in case we are looping */
@@ -161,7 +165,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -173,7 +177,7 @@
/* make sure the process ID is root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root.");
+ tst_brkm(TBROK, NULL, "Test must be run as root.");
}
/* capture signals */
@@ -211,7 +215,4 @@
* Delete the test directory created in setup().
*/
tst_rmdir();
-
- /* exit with return code appropriate for results */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/fchmod/fchmod01.c b/testcases/kernel/syscalls/fchmod/fchmod01.c
index e6bc01b..f2b2398 100644
--- a/testcases/kernel/syscalls/fchmod/fchmod01.c
+++ b/testcases/kernel/syscalls/fchmod/fchmod01.c
@@ -136,7 +136,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fchmod/fchmod02.c b/testcases/kernel/syscalls/fchmod/fchmod02.c
index 93abd8f..5e34816 100644
--- a/testcases/kernel/syscalls/fchmod/fchmod02.c
+++ b/testcases/kernel/syscalls/fchmod/fchmod02.c
@@ -107,7 +107,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -165,7 +169,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/fchmod/fchmod03.c b/testcases/kernel/syscalls/fchmod/fchmod03.c
index bed17e3..77cf4ca 100644
--- a/testcases/kernel/syscalls/fchmod/fchmod03.c
+++ b/testcases/kernel/syscalls/fchmod/fchmod03.c
@@ -108,7 +108,11 @@
mode_t file_mode; /* mode permissions set on testfile */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -166,7 +170,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
/*
@@ -182,7 +186,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (seteuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/fchmod/fchmod04.c b/testcases/kernel/syscalls/fchmod/fchmod04.c
index 5d6174f..216b936 100644
--- a/testcases/kernel/syscalls/fchmod/fchmod04.c
+++ b/testcases/kernel/syscalls/fchmod/fchmod04.c
@@ -108,7 +108,11 @@
mode_t dir_mode; /* mode permissions set on testdirectory */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -167,7 +171,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
/*
@@ -184,7 +188,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (seteuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/fchmod/fchmod05.c b/testcases/kernel/syscalls/fchmod/fchmod05.c
index 770e458..b8c94f4 100644
--- a/testcases/kernel/syscalls/fchmod/fchmod05.c
+++ b/testcases/kernel/syscalls/fchmod/fchmod05.c
@@ -109,7 +109,11 @@
mode_t dir_mode; /* mode permissions set on test directory */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -167,7 +171,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/fchmod/fchmod06.c b/testcases/kernel/syscalls/fchmod/fchmod06.c
index 75faa24..feebc7f 100644
--- a/testcases/kernel/syscalls/fchmod/fchmod06.c
+++ b/testcases/kernel/syscalls/fchmod/fchmod06.c
@@ -135,7 +135,11 @@
int mode; /* creation mode for the node created */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -202,7 +206,7 @@
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
/*
@@ -222,7 +226,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (seteuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/fchmod/fchmod07.c b/testcases/kernel/syscalls/fchmod/fchmod07.c
index 7b15b3e..48935c3 100644
--- a/testcases/kernel/syscalls/fchmod/fchmod07.c
+++ b/testcases/kernel/syscalls/fchmod/fchmod07.c
@@ -100,7 +100,11 @@
TST_TOTAL = sizeof(Modes) / sizeof(int);
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -171,7 +175,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/fchmodat/fchmodat01.c b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
index b19ff4b..9d53286 100644
--- a/testcases/kernel/syscalls/fchmodat/fchmodat01.c
+++ b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
@@ -99,7 +99,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fchown/fchown01.c b/testcases/kernel/syscalls/fchown/fchown01.c
index ce1f7b2..151d9ef 100644
--- a/testcases/kernel/syscalls/fchown/fchown01.c
+++ b/testcases/kernel/syscalls/fchown/fchown01.c
@@ -136,7 +136,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fchown/fchown02.c b/testcases/kernel/syscalls/fchown/fchown02.c
index 451569b..64e0d37 100644
--- a/testcases/kernel/syscalls/fchown/fchown02.c
+++ b/testcases/kernel/syscalls/fchown/fchown02.c
@@ -121,15 +121,19 @@
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
int ind; /* counter variable for chmod(2) tests */
- uid_t User_id; /* user id of the user set for testfile */
- gid_t Group_id; /* group id of the user set for testfile */
+ uid_t user_id; /* user id of the user set for testfile */
+ gid_t group_id; /* group id of the user set for testfile */
int fildes; /* File descriptor for testfile */
int test_flag; /* test condition specific flag variable */
char *file_name; /* ptr. for test file name */
char *test_desc; /* test specific message */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -147,8 +151,8 @@
fildes = Test_cases[ind].fd;
file_name = Test_cases[ind].pathname;
test_desc = Test_cases[ind].desc;
- User_id = Test_cases[ind].user_id;
- Group_id = Test_cases[ind].group_id;
+ user_id = Test_cases[ind].user_id;
+ group_id = Test_cases[ind].group_id;
test_flag = Test_cases[ind].test_flag;
if (fildes == 1) {
@@ -162,7 +166,7 @@
* group id (numeric values) to set it on
* testfile.
*/
- TEST(fchown(fildes, User_id, Group_id));
+ TEST(fchown(fildes, user_id, group_id));
/* check return code of fchown(2) */
if (TEST_RETURN == -1) {
@@ -190,12 +194,12 @@
* Check for expected Ownership ids
* set on testfile.
*/
- if ((stat_buf.st_uid != User_id) ||
- (stat_buf.st_gid != Group_id)) {
+ if ((stat_buf.st_uid != user_id) ||
+ (stat_buf.st_gid != group_id)) {
tst_resm(TFAIL, "%s: Incorrect"
" ownership set, Expected %d "
"%d", file_name,
- User_id, Group_id);
+ user_id, group_id);
}
/*
@@ -232,7 +236,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return (0);
+ return (0);
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/fchown/fchown03.c b/testcases/kernel/syscalls/fchown/fchown03.c
index 863fdd9..d7b3fe1 100644
--- a/testcases/kernel/syscalls/fchown/fchown03.c
+++ b/testcases/kernel/syscalls/fchown/fchown03.c
@@ -103,11 +103,15 @@
struct stat stat_buf; /* stat(2) struct contents */
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
- uid_t User_id; /* Owner id of the test file. */
- gid_t Group_id; /* Group id of the test file. */
+ uid_t user_id; /* Owner id of the test file. */
+ gid_t group_id; /* Group id of the test file. */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -122,15 +126,15 @@
Tst_count = 0;
/* Get the euid/egid of the process */
- User_id = geteuid();
- Group_id = getegid();
+ user_id = geteuid();
+ group_id = getegid();
/*
* Call fchwon(2) with different user id and
* group id (numeric values) to set it on
* testfile.
*/
- TEST(fchown(fildes, -1, Group_id));
+ TEST(fchown(fildes, -1, group_id));
/* check return code of fchown(2) */
if (TEST_RETURN == -1) {
@@ -157,11 +161,11 @@
* Check for expected Ownership ids
* set on testfile.
*/
- if ((stat_buf.st_uid != User_id) ||
- (stat_buf.st_gid != Group_id)) {
+ if ((stat_buf.st_uid != user_id) ||
+ (stat_buf.st_gid != group_id)) {
tst_resm(TFAIL, "%s: Incorrect "
"ownership set, Expected %d %d",
- TESTFILE, User_id, Group_id);
+ TESTFILE, user_id, group_id);
}
/*
@@ -185,7 +189,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return (0);
+ return (0);
} /* End main */
/*
@@ -202,7 +206,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (seteuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/fchown/fchown04.c b/testcases/kernel/syscalls/fchown/fchown04.c
index 03ebaa6..743873e 100644
--- a/testcases/kernel/syscalls/fchown/fchown04.c
+++ b/testcases/kernel/syscalls/fchown/fchown04.c
@@ -126,11 +126,15 @@
char *test_desc; /* test specific error message */
int fd; /* test file descriptor */
int ind; /* counter to test different test conditions */
- uid_t User_id; /* Effective user id of a test process */
- gid_t Group_id; /* Effective group id of a test process */
+ uid_t user_id; /* Effective user id of a test process */
+ gid_t group_id; /* Effective group id of a test process */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -146,8 +150,8 @@
TEST_EXP_ENOS(exp_enos);
/* Set uid/gid values to that of test process */
- User_id = geteuid();
- Group_id = getegid();
+ user_id = geteuid();
+ group_id = getegid();
/* Check looping state if -i option given */
for (lc = 0; TEST_LOOPING(lc); lc++) {
@@ -169,7 +173,7 @@
* verify that it fails with -1 return value and
* sets appropriate errno.
*/
- TEST(fchown(fd, User_id, Group_id));
+ TEST(fchown(fd, user_id, group_id));
/* Check return code from fchown(2) */
if (TEST_RETURN == -1) {
@@ -199,7 +203,7 @@
*/
cleanup();
- /*NOTREACHED*/ return (0);
+ return (0);
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/fchown/fchown05.c b/testcases/kernel/syscalls/fchown/fchown05.c
index 26e2039..2475982 100644
--- a/testcases/kernel/syscalls/fchown/fchown05.c
+++ b/testcases/kernel/syscalls/fchown/fchown05.c
@@ -109,12 +109,16 @@
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
int ind; /* counter variable for chmod(2) tests */
- uid_t User_id; /* user id of the user set for testfile */
- gid_t Group_id; /* group id of the user set for testfile */
+ uid_t user_id; /* user id of the user set for testfile */
+ gid_t group_id; /* group id of the user set for testfile */
char *test_desc; /* test specific message */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -130,15 +134,15 @@
for (ind = 0; Test_cases[ind].desc != NULL; ind++) {
test_desc = Test_cases[ind].desc;
- User_id = Test_cases[ind].user_id;
- Group_id = Test_cases[ind].group_id;
+ user_id = Test_cases[ind].user_id;
+ group_id = Test_cases[ind].group_id;
/*
* Call fchwon(2) with different user id and
* group id (numeric values) to set it on
* testfile.
*/
- TEST(fchown(fildes, User_id, Group_id));
+ TEST(fchown(fildes, user_id, group_id));
/* check return code of fchown(2) */
if (TEST_RETURN == -1) {
@@ -161,22 +165,22 @@
"%s failed, errno:%d",
TESTFILE, TEST_ERRNO);
}
- if (User_id == -1) {
- User_id = Test_cases[ind - 1].user_id;
+ if (user_id == -1) {
+ user_id = Test_cases[ind - 1].user_id;
}
- if (Group_id == -1) {
- Group_id = Test_cases[ind - 1].group_id;
+ if (group_id == -1) {
+ group_id = Test_cases[ind - 1].group_id;
}
/*
* Check for expected Ownership ids
* set on testfile.
*/
- if ((stat_buf.st_uid != User_id) ||
- (stat_buf.st_gid != Group_id)) {
+ if ((stat_buf.st_uid != user_id) ||
+ (stat_buf.st_gid != group_id)) {
tst_resm(TFAIL, "%s: Incorrect owner"
"ship set, Expected %d %d",
- TESTFILE, User_id, Group_id);
+ TESTFILE, user_id, group_id);
} else {
tst_resm(TPASS,
"fchown() succeeds to %s of %s",
@@ -191,7 +195,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return (0);
+ return (0);
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/fchownat/fchownat01.c b/testcases/kernel/syscalls/fchownat/fchownat01.c
index 986c670..664dbea 100644
--- a/testcases/kernel/syscalls/fchownat/fchownat01.c
+++ b/testcases/kernel/syscalls/fchownat/fchownat01.c
@@ -103,7 +103,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fcntl/fcntl01.c b/testcases/kernel/syscalls/fcntl/fcntl01.c
index 1531240..e2f85d7 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl01.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl01.c
@@ -55,7 +55,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -275,7 +279,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/fcntl/fcntl02.c b/testcases/kernel/syscalls/fcntl/fcntl02.c
index cc5b2f3..32f6bf4 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl02.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl02.c
@@ -140,7 +140,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fcntl/fcntl03.c b/testcases/kernel/syscalls/fcntl/fcntl03.c
index 88bbd81..842f3d1 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl03.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl03.c
@@ -140,7 +140,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fcntl/fcntl04.c b/testcases/kernel/syscalls/fcntl/fcntl04.c
index fe7ac04..6ad5720 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl04.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl04.c
@@ -140,7 +140,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fcntl/fcntl05.c b/testcases/kernel/syscalls/fcntl/fcntl05.c
index 6943a92..364862b 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl05.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl05.c
@@ -141,7 +141,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fcntl/fcntl06.c b/testcases/kernel/syscalls/fcntl/fcntl06.c
index 1dee9bf..e830778 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl06.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl06.c
@@ -79,7 +79,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -94,7 +98,7 @@
tst_resm(TINFO, "fcntl remote locking feature not "
"implemented in the kernel: exitting");
cleanup();
- /*NOTREACHED*/} else {
+ } else {
tst_resm(TPASS, "fcntl on file failed: Test " "PASSED");
}
}
diff --git a/testcases/kernel/syscalls/fcntl/fcntl09.c b/testcases/kernel/syscalls/fcntl/fcntl09.c
index 0d475c8..f57e47a 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl09.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl09.c
@@ -141,7 +141,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fcntl/fcntl10.c b/testcases/kernel/syscalls/fcntl/fcntl10.c
index 92998e4..5e6b43d 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl10.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl10.c
@@ -141,7 +141,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fcntl/fcntl11.c b/testcases/kernel/syscalls/fcntl/fcntl11.c
index 26838db..b829fc9 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl11.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl11.c
@@ -300,7 +300,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child, "ddddd", &parent_pipe[0],
diff --git a/testcases/kernel/syscalls/fcntl/fcntl12.c b/testcases/kernel/syscalls/fcntl/fcntl12.c
index 4f5ed31..c150e82 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl12.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl12.c
@@ -65,7 +65,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -85,7 +89,7 @@
if (pid < 0) {
tst_resm(TFAIL, "Fork failed");
cleanup();
- /*NOTREACHED*/} else if (pid == 0) { /* child */
+ } else if (pid == 0) { /* child */
max_files = getdtablesize();
for (i = 0; i < max_files; i++) {
if ((fd = open(fname, O_CREAT | O_RDONLY,
@@ -113,7 +117,7 @@
tst_resm(TINFO, "Exit block 1");
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/fcntl/fcntl13.c b/testcases/kernel/syscalls/fcntl/fcntl13.c
index fe09cba..e26b40f 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl13.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl13.c
@@ -58,7 +58,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -182,7 +186,7 @@
tst_resm(TINFO, "Exit block 4");
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/fcntl/fcntl14.c b/testcases/kernel/syscalls/fcntl/fcntl14.c
index 31119ab..0c09d7c 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl14.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl14.c
@@ -596,7 +596,7 @@
tst_resm(TFAIL, "SIGUSR1 signal setup failed, errno = %d",
errno);
cleanup();
- /*NOTREACHED*/}
+ }
memset(&act, 0, sizeof(act));
act.sa_handler = catch_alarm;
@@ -605,7 +605,7 @@
if ((sigaction(SIGALRM, &act, NULL)) < 0) {
tst_resm(TFAIL, "SIGALRM signal setup failed");
cleanup();
- /*NOTREACHED*/}
+ }
}
void wake_parent(void)
@@ -804,18 +804,18 @@
fd = open(tmpname, file_flag, file_mode);
if (fd < 0) {
tst_brkm(TBROK, cleanup, "open() failed");
- /*NOTREACHED*/}
+ }
/* write some dummy data to the file */
if (write(fd, FILEDATA, 10) < 0) {
tst_brkm(TBROK, cleanup, "write() failed");
- /*NOTREACHED*/}
+ }
/* seek into file if indicated */
if (seek) {
if (lseek(fd, seek, 0) < 0) {
tst_brkm(TBROK, cleanup, "lseek() failed");
- /*NOTREACHED*/}
+ }
}
/* Initialize first parent lock structure */
@@ -871,7 +871,7 @@
thiscase->a_type, fd, test, parent) < 0) {
tst_resm(TFAIL, "self_exec failed");
cleanup();
- /*NOTREACHED*/}
+ }
#else
dochild();
#endif
@@ -879,7 +879,7 @@
if (child < 0) {
tst_resm(TFAIL, "Fork failed");
cleanup();
- /*NOTREACHED*/}
+ }
/* parent process */
if ((thiscase->c_flag) == WILLBLOCK) {
/*
@@ -975,7 +975,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
argv0 = av[0];
@@ -1067,12 +1071,12 @@
fd = open(tmpname, O_CREAT | O_RDWR | O_TRUNC, 0777);
if (fd < 0) {
tst_brkm(TBROK, cleanup, "open failed");
- /*NOTREACHED*/}
+ }
/* Write some dummy data to the file */
if (write(fd, FILEDATA, 10) < 0) {
tst_brkm(TBROK, cleanup, "write failed");
- /*NOTREACHED*/}
+ }
/* Initialize lock structure */
flock.l_type = F_WRLCK;
@@ -1118,12 +1122,12 @@
fd = open(tmpname, O_CREAT | O_RDWR | O_TRUNC, 0777);
if (fd < 0) {
tst_brkm(TBROK, cleanup, "open failed");
- /*NOTREACHED*/}
+ }
/* Write some dummy data to the file */
if (write(fd, FILEDATA, 10) < 0) {
tst_brkm(TBROK, cleanup, "write failed");
- /*NOTREACHED*/}
+ }
/* Initialize first parent lock structure */
thiscase = &testcases[58];
@@ -1142,12 +1146,12 @@
/* Write some additional data to end of file */
if (write(fd, FILEDATA, 10) < 0) {
tst_brkm(TBROK, cleanup, "write failed");
- /*NOTREACHED*/}
+ }
/* Mask signal to avoid race */
if (sighold(SIGUSR1) < 0) {
tst_brkm(TBROK, cleanup, "sighold failed");
- /*NOTREACHED*/}
+ }
/* spawn a child process */
if ((child = FORK_OR_VFORK()) == 0) {
@@ -1158,7 +1162,7 @@
thiscase->a_type, fd, test, parent) < 0) {
tst_resm(TFAIL, "self_exec failed");
cleanup();
- /*NOTREACHED*/}
+ }
#else
dochild();
#endif
@@ -1166,7 +1170,7 @@
if (child < 0) {
tst_resm(TFAIL, "Fork failed");
cleanup();
- /*NOTREACHED*/}
+ }
/* parent process */
diff --git a/testcases/kernel/syscalls/fcntl/fcntl15.c b/testcases/kernel/syscalls/fcntl/fcntl15.c
index 24efeb1..a375224 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl15.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl15.c
@@ -541,7 +541,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&dochild1_uc, "nddds", 1, &uc_file_flag,
diff --git a/testcases/kernel/syscalls/fcntl/fcntl16.c b/testcases/kernel/syscalls/fcntl/fcntl16.c
index 0dc9090..7b806c9 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl16.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl16.c
@@ -464,7 +464,7 @@
fd = open(tmpname, file_flag, file_mode);
if (fd < 0) {
tst_brkm(TBROK, cleanup, "open failed");
- /*NOTREACHED*/}
+ }
/* write some dummy data to the file */
(void)write(fd, FILEDATA, 10);
@@ -664,7 +664,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(dochild_uc, "ddddd", &kid_uc, &parent, &test,
diff --git a/testcases/kernel/syscalls/fcntl/fcntl17.c b/testcases/kernel/syscalls/fcntl/fcntl17.c
index 1f57416..b2d66c0 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl17.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl17.c
@@ -393,7 +393,7 @@
{
tst_resm(TFAIL, "Unexpected death of child process");
cleanup();
- /*NOTREACHED*/}
+ }
void catch_alarm()
{
@@ -415,7 +415,7 @@
tst_resm(TFAIL, "Alarm expired, deadlock not detected");
tst_resm(TWARN, "You may need to kill child processes by hand");
cleanup();
- /*NOTREACHED*/}
+ }
int main(int ac, char **av)
{
@@ -426,7 +426,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child1, "nddddddddd", 1, &file_fd,
@@ -449,7 +453,7 @@
if (setup()) { /* global testup */
tst_resm(TINFO, "setup failed");
cleanup();
- /*NOTREACHED*/}
+ }
/* check for looping state if -i option is given */
for (lc = 0; TEST_LOOPING(lc); lc++) {
@@ -473,7 +477,7 @@
} else if (child_pid1 < 0) {
perror("Fork failed: child 1");
cleanup();
- /*NOTREACHED*/}
+ }
/* parent */
@@ -497,7 +501,7 @@
"1 failed");
}
cleanup();
- /*NOTREACHED*/}
+ }
/* parent */
@@ -526,7 +530,7 @@
"failed");
}
cleanup();
- /*NOTREACHED*/}
+ }
/* parent */
close(parent_pipe[1]);
diff --git a/testcases/kernel/syscalls/fcntl/fcntl18.c b/testcases/kernel/syscalls/fcntl/fcntl18.c
index 678b493..4adcba3 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl18.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl18.c
@@ -71,7 +71,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
diff --git a/testcases/kernel/syscalls/fcntl/fcntl19.c b/testcases/kernel/syscalls/fcntl/fcntl19.c
index 617f17e..d10d8a6 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl19.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl19.c
@@ -307,7 +307,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child, "ddddd", &parent_pipe[0], &parent_pipe[1],
diff --git a/testcases/kernel/syscalls/fcntl/fcntl20.c b/testcases/kernel/syscalls/fcntl/fcntl20.c
index 761ddf9..6afc7c2 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl20.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl20.c
@@ -302,7 +302,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child, "ddddd", &parent_pipe[0], &parent_pipe[1],
diff --git a/testcases/kernel/syscalls/fcntl/fcntl21.c b/testcases/kernel/syscalls/fcntl/fcntl21.c
index 888b4ac..85b2666 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl21.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl21.c
@@ -303,7 +303,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child, "ddddd", &parent_pipe[0], &parent_pipe[1],
diff --git a/testcases/kernel/syscalls/fcntl/fcntl22.c b/testcases/kernel/syscalls/fcntl/fcntl22.c
index f3152f0..4a109a3 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl22.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl22.c
@@ -104,7 +104,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* setup */
diff --git a/testcases/kernel/syscalls/fcntl/fcntl23.c b/testcases/kernel/syscalls/fcntl/fcntl23.c
index 26c526f..6962d61 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl23.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl23.c
@@ -116,7 +116,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fcntl/fcntl24.c b/testcases/kernel/syscalls/fcntl/fcntl24.c
index ef74b41..33c092f 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl24.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl24.c
@@ -116,7 +116,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fcntl/fcntl25.c b/testcases/kernel/syscalls/fcntl/fcntl25.c
index 8088dbe..add616f 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl25.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl25.c
@@ -117,7 +117,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fcntl/fcntl26.c b/testcases/kernel/syscalls/fcntl/fcntl26.c
index d232607..c72c127 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl26.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl26.c
@@ -117,7 +117,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fcntl/fcntl27.c b/testcases/kernel/syscalls/fcntl/fcntl27.c
index d81e22c..03779b9 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl27.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl27.c
@@ -117,7 +117,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fcntl/fcntl28.c b/testcases/kernel/syscalls/fcntl/fcntl28.c
index c825787..cd163d9 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl28.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl28.c
@@ -114,7 +114,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fdatasync/fdatasync01.c b/testcases/kernel/syscalls/fdatasync/fdatasync01.c
index 3e4e4c7..9e6b454 100644
--- a/testcases/kernel/syscalls/fdatasync/fdatasync01.c
+++ b/testcases/kernel/syscalls/fdatasync/fdatasync01.c
@@ -118,7 +118,7 @@
/* perform global cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
@@ -139,13 +139,13 @@
/* Initialize unique filename for each child process */
if (sprintf(filename, "fdatasync_%d", getpid()) <= 0) {
tst_brkm(TBROK, cleanup, "Failed to initialize filename");
- /*NOTREACHED*/}
+ }
if ((fd = open(filename, O_CREAT | O_WRONLY, 0777)) == -1) { //mode must be specified when O_CREATE is in the flag
tst_brkm(TBROK, cleanup, "open() failed");
- /*NOTREACHED*/}
+ }
if ((write(fd, filename, strlen(filename) + 1)) == -1) {
tst_brkm(TBROK, cleanup, "write() failed");
- /*NOTREACHED*/}
+ }
}
/*
@@ -168,4 +168,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/fdatasync/fdatasync02.c b/testcases/kernel/syscalls/fdatasync/fdatasync02.c
index da22d48..7f20d6a 100644
--- a/testcases/kernel/syscalls/fdatasync/fdatasync02.c
+++ b/testcases/kernel/syscalls/fdatasync/fdatasync02.c
@@ -154,7 +154,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
int setup1(void)
@@ -177,7 +177,7 @@
{
/* close special file */
if (close(fd) == -1) {
- tst_brkm(TBROK, tst_exit, "Failed to close fd of %s", SPL_FILE);
+ tst_brkm(TBROK, NULL, "Failed to close fd of %s", SPL_FILE);
}
}
@@ -215,4 +215,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/flock/flock01.c b/testcases/kernel/syscalls/flock/flock01.c
index 32b4048..db221c6 100644
--- a/testcases/kernel/syscalls/flock/flock01.c
+++ b/testcases/kernel/syscalls/flock/flock01.c
@@ -103,7 +103,7 @@
if ((msg = parse_opts(argc, argv, NULL, NULL)) !=
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+ }
/* global setup */
setup();
@@ -203,4 +203,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/flock/flock02.c b/testcases/kernel/syscalls/flock/flock02.c
index 491022a..8f66f0e 100644
--- a/testcases/kernel/syscalls/flock/flock02.c
+++ b/testcases/kernel/syscalls/flock/flock02.c
@@ -101,7 +101,7 @@
if ((msg = parse_opts(argc, argv, NULL, NULL)) !=
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+ }
/* global setup */
setup();
@@ -222,4 +222,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/flock/flock03.c b/testcases/kernel/syscalls/flock/flock03.c
index 9245008..dcb82cc 100644
--- a/testcases/kernel/syscalls/flock/flock03.c
+++ b/testcases/kernel/syscalls/flock/flock03.c
@@ -99,7 +99,7 @@
if ((msg = parse_opts(argc, argv, NULL, NULL)) !=
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+ }
#ifdef UCLINUX
maybe_run_child(&childfunc_uc, "ds", &fd_uc, filename);
#endif
@@ -257,4 +257,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/flock/flock04.c b/testcases/kernel/syscalls/flock/flock04.c
index 83f2b06..bed1c22 100644
--- a/testcases/kernel/syscalls/flock/flock04.c
+++ b/testcases/kernel/syscalls/flock/flock04.c
@@ -101,7 +101,7 @@
if ((msg = parse_opts(argc, argv, NULL, NULL)) !=
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+ }
/* global setup */
setup();
@@ -169,7 +169,7 @@
cleanup();
return 0;
- /*NOTREACHED*/}
+ }
/*
* setup()
@@ -229,4 +229,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/flock/flock05.c b/testcases/kernel/syscalls/flock/flock05.c
index d5c9f76..f440164 100644
--- a/testcases/kernel/syscalls/flock/flock05.c
+++ b/testcases/kernel/syscalls/flock/flock05.c
@@ -101,7 +101,7 @@
if ((msg = parse_opts(argc, argv, NULL, NULL)) !=
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+ }
/* global setup */
setup();
@@ -168,7 +168,7 @@
close(fd1);
cleanup();
return 0;
- /*NOTREACHED*/}
+ }
/*
* setup()
@@ -228,4 +228,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/flock/flock06.c b/testcases/kernel/syscalls/flock/flock06.c
index e54838f..1d268fb 100644
--- a/testcases/kernel/syscalls/flock/flock06.c
+++ b/testcases/kernel/syscalls/flock/flock06.c
@@ -86,7 +86,7 @@
if ((msg = parse_opts(argc, argv, NULL, NULL)) !=
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+ }
setup();
@@ -200,4 +200,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/fork/fork01.c b/testcases/kernel/syscalls/fork/fork01.c
index 8d7c3f8..a284293 100644
--- a/testcases/kernel/syscalls/fork/fork01.c
+++ b/testcases/kernel/syscalls/fork/fork01.c
@@ -206,7 +206,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fork/fork02.c b/testcases/kernel/syscalls/fork/fork02.c
index 7babc56..0182655 100644
--- a/testcases/kernel/syscalls/fork/fork02.c
+++ b/testcases/kernel/syscalls/fork/fork02.c
@@ -67,8 +67,12 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
/*
* perform global setup for the test
@@ -105,7 +109,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/fork/fork03.c b/testcases/kernel/syscalls/fork/fork03.c
index 0661b8d..3e907d7 100644
--- a/testcases/kernel/syscalls/fork/fork03.c
+++ b/testcases/kernel/syscalls/fork/fork03.c
@@ -67,8 +67,12 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
/*
* perform global setup for the test
@@ -127,7 +131,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/fork/fork06.c b/testcases/kernel/syscalls/fork/fork06.c
index c0c3d7c..7ac8e8e 100644
--- a/testcases/kernel/syscalls/fork/fork06.c
+++ b/testcases/kernel/syscalls/fork/fork06.c
@@ -65,8 +65,12 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
/*
* perform global setup for the test
@@ -115,7 +119,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/fork/fork07.c b/testcases/kernel/syscalls/fork/fork07.c
index 3ce523a..97c5673 100644
--- a/testcases/kernel/syscalls/fork/fork07.c
+++ b/testcases/kernel/syscalls/fork/fork07.c
@@ -86,8 +86,12 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, options, &help)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
if (Nflag) {
if (sscanf(Nforkarg, "%i", &Nforks) != 1) {
@@ -201,7 +205,7 @@
fclose(rea);
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
void help()
diff --git a/testcases/kernel/syscalls/fork/fork08.c b/testcases/kernel/syscalls/fork/fork08.c
index ec3d609..d10d341 100644
--- a/testcases/kernel/syscalls/fork/fork08.c
+++ b/testcases/kernel/syscalls/fork/fork08.c
@@ -70,8 +70,12 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
/*
* perform global setup for the test
@@ -169,7 +173,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/fork/fork09.c b/testcases/kernel/syscalls/fork/fork09.c
index 02515b3..a5e0eb6 100644
--- a/testcases/kernel/syscalls/fork/fork09.c
+++ b/testcases/kernel/syscalls/fork/fork09.c
@@ -76,8 +76,12 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
/*
* perform global setup for the test
@@ -87,7 +91,7 @@
fildeses = (FILE **) malloc((OPEN_MAX + 10) * sizeof(FILE *));
if (fildeses == NULL) {
tst_brkm(TBROK, cleanup, "malloc failed");
- /*NOTREACHED*/}
+ }
/*
* check looping state if -i option is given
@@ -107,7 +111,7 @@
if ((first = creat(filname, 0660)) == -1) {
tst_brkm(TBROK, cleanup, "Cannot open first file %s, "
"errno = %d", filname, errno);
- /*NOTREACHED*/}
+ }
close(first);
tst_resm(TINFO, "first file descriptor is %d ", first);
@@ -115,7 +119,7 @@
if (unlink(filname) == -1) {
tst_brkm(TBROK, cleanup, "Cannot unlink file %s, "
"errno = %d", filname, errno);
- /*NOTREACHED*/}
+ }
/*
* now open all the files for the test
@@ -129,7 +133,7 @@
tst_brkm(TBROK, cleanup, "Parent: cannot open "
"file %d %s errno = %d", nfiles,
filname, errno);
- /*NOTREACHED*/}
+ }
#ifdef DEBUG
tst_resm(TINFO, "filname: %s", filname);
#endif
@@ -139,7 +143,7 @@
if ((pid = fork()) == -1) {
tst_brkm(TBROK, cleanup, "Fork failed");
- /*NOTREACHED*/}
+ }
if (pid == 0) { /* child */
nfiles--;
@@ -147,7 +151,7 @@
tst_resm(TINFO, "Child could not close file "
"#%d, errno = %d", nfiles, errno);
exit(1);
- /*NOTREACHED*/} else {
+ } else {
sprintf(childfile, "cfile.%d", getpid());
if ((fildeses[nfiles] =
fopen(childfile, "a")) == NULL) {
@@ -155,7 +159,7 @@
"file %s, errno = %d",
childfile, errno);
exit(1);
- /*NOTREACHED*/} else {
+ } else {
tst_resm(TINFO, "Child opened new "
"file #%d", nfiles);
unlink(childfile);
@@ -180,7 +184,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/fork/fork10.c b/testcases/kernel/syscalls/fork/fork10.c
index 90448e0..3774277 100644
--- a/testcases/kernel/syscalls/fork/fork10.c
+++ b/testcases/kernel/syscalls/fork/fork10.c
@@ -71,8 +71,12 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
/*
* perform global setup for the test
@@ -91,18 +95,18 @@
if ((fildes = creat(fnamebuf, 0600)) < 0) {
tst_brkm(TBROK, cleanup, "Parent: cannot open %s for "
"write, errno = %d", fnamebuf, errno);
- /*NOTREACHED*/}
+ }
write(fildes, "ABCDEFGHIJKLMNOPQRSTUVWXYZ\n", 27);
close(fildes);
if ((fildes = open(fnamebuf, 0)) == -1) {
tst_brkm(TBROK, cleanup, "Parent: cannot open %s for "
"reading", fnamebuf);
- /*NOTREACHED*/}
+ }
if ((pid = fork()) == -1) {
tst_brkm(TBROK, cleanup, "fork() #1 failed");
- /*NOTREACHED*/}
+ }
if (pid == 0) { /* child */
tst_resm(TINFO, "fork child A");
@@ -117,7 +121,7 @@
/* parent starts second child */
if ((pid = fork()) == -1) {
tst_brkm(TBROK, cleanup, "fork() #2 failed");
- /*NOTREACHED*/}
+ }
if (pid == 0) { /* child */
if (read(fildes, chilchar, 1) <= 0) {
@@ -159,7 +163,7 @@
close(fildes);
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/fork/fork11.c b/testcases/kernel/syscalls/fork/fork11.c
index e2e0ebe..2f46fa2 100644
--- a/testcases/kernel/syscalls/fork/fork11.c
+++ b/testcases/kernel/syscalls/fork/fork11.c
@@ -64,8 +64,12 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
/*
* perform global setup for the test
@@ -105,7 +109,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/fork/fork12.c b/testcases/kernel/syscalls/fork/fork12.c
index f5203d6..d0733fe 100644
--- a/testcases/kernel/syscalls/fork/fork12.c
+++ b/testcases/kernel/syscalls/fork/fork12.c
@@ -69,8 +69,12 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
/*
* perform global setup for the test
@@ -122,7 +126,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/fstat/fstat01.c b/testcases/kernel/syscalls/fstat/fstat01.c
index 0c784cb..6861c07 100644
--- a/testcases/kernel/syscalls/fstat/fstat01.c
+++ b/testcases/kernel/syscalls/fstat/fstat01.c
@@ -140,7 +140,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fstat/fstat02.c b/testcases/kernel/syscalls/fstat/fstat02.c
index a763556..b2366b2 100644
--- a/testcases/kernel/syscalls/fstat/fstat02.c
+++ b/testcases/kernel/syscalls/fstat/fstat02.c
@@ -86,8 +86,8 @@
char *TCID = "fstat02"; /* Test program identifier. */
int TST_TOTAL = 1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
-uid_t User_id; /* user id/group id of test process */
-gid_t Group_id;
+uid_t user_id; /* user id/group id of test process */
+gid_t group_id;
int fildes; /* File descriptor of testfile */
char nobody_uid[] = "nobody";
@@ -103,7 +103,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -138,8 +142,8 @@
* Verify the data returned by fstat(2)
* aganist the expected data.
*/
- if ((stat_buf.st_uid != User_id) ||
- (stat_buf.st_gid != Group_id) ||
+ if ((stat_buf.st_uid != user_id) ||
+ (stat_buf.st_gid != group_id) ||
(stat_buf.st_size != FILE_SIZE) ||
((stat_buf.st_mode & MASK) != FILE_MODE)) {
tst_resm(TFAIL, "Functionality of fstat(2) on "
@@ -156,7 +160,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
/*
@@ -178,7 +182,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1)
@@ -212,8 +216,8 @@
}
/* Get the uid/gid of the process */
- User_id = getuid();
- Group_id = getgid();
+ user_id = getuid();
+ group_id = getgid();
} /* End setup() */
diff --git a/testcases/kernel/syscalls/fstat/fstat03.c b/testcases/kernel/syscalls/fstat/fstat03.c
index 7352eb8..2aeddbb 100644
--- a/testcases/kernel/syscalls/fstat/fstat03.c
+++ b/testcases/kernel/syscalls/fstat/fstat03.c
@@ -78,7 +78,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -124,7 +128,7 @@
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/fstat/fstat04.c b/testcases/kernel/syscalls/fstat/fstat04.c
index d68c1dc..5484174 100644
--- a/testcases/kernel/syscalls/fstat/fstat04.c
+++ b/testcases/kernel/syscalls/fstat/fstat04.c
@@ -85,8 +85,8 @@
char *TCID = "fstat04"; /* Test program identifier. */
int TST_TOTAL = 1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
-uid_t User_id; /* user id/group id of test process */
-gid_t Group_id;
+uid_t user_id; /* user id/group id of test process */
+gid_t group_id;
int fildes; /* File descriptor of testfile */
char nobody_uid[] = "nobody";
@@ -102,7 +102,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -137,8 +141,8 @@
* Verify the data returned by fstat(2)
* aganist the expected data.
*/
- if ((stat_buf.st_uid != User_id) ||
- (stat_buf.st_gid != Group_id) ||
+ if ((stat_buf.st_uid != user_id) ||
+ (stat_buf.st_gid != group_id) ||
(stat_buf.st_size != FILE_SIZE) ||
((stat_buf.st_mode & MASK) != FILE_MODE)) {
tst_resm(TFAIL, "Functionality of fstat(2) on "
@@ -155,7 +159,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
/*
@@ -177,7 +181,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1)
@@ -211,8 +215,8 @@
}
/* Get the uid/gid of the process */
- User_id = getuid();
- Group_id = getgid();
+ user_id = getuid();
+ group_id = getgid();
} /* End setup() */
diff --git a/testcases/kernel/syscalls/fstat/fstat05.c b/testcases/kernel/syscalls/fstat/fstat05.c
index 9d11f56..3f56ff3 100644
--- a/testcases/kernel/syscalls/fstat/fstat05.c
+++ b/testcases/kernel/syscalls/fstat/fstat05.c
@@ -137,11 +137,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
/* Buffer points outside user's accessible address space. */
ptr_str = &stat_buf; /* if it was for conformance testing */
@@ -189,7 +193,7 @@
* in the setup().
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
#else
@@ -223,7 +227,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
diff --git a/testcases/kernel/syscalls/fstatat/fstatat01.c b/testcases/kernel/syscalls/fstatat/fstatat01.c
index 275498b..dc443f6 100644
--- a/testcases/kernel/syscalls/fstatat/fstatat01.c
+++ b/testcases/kernel/syscalls/fstatat/fstatat01.c
@@ -113,28 +113,10 @@
/* Disable test if the version of the kernel is less than 2.6.16 */
if ((tst_kvercmp(2, 6, 16)) < 0) {
- tst_resm(TWARN, "This test can only run on kernels that are ");
- tst_resm(TWARN, "2.6.16 and higher");
- exit(0);
+ tst_brkm(TCONF, NULL,
+ "This test can only run on kernels that are 2.6.16 and higher");
}
- /* report failure if run with stubs */
-#ifdef __NR_fstatat64
- if (__NR_fstatat64 == 0)
-#endif
-#ifdef __NR_newfstatat
- if (__NR_newfstatat == 0)
-#endif
- {
- tst_resm(TFAIL,
- "fstatat() Failed, neither __NR_fstatat64 "
- "no __NR_newfstatat is implemented ");
- exit(0);
- }
-
- /***************************************************************
- * parse standard options
- ***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
@@ -167,16 +149,11 @@
***************************************************************/
if (STD_FUNCTIONAL_TEST) {
/* No Verification test, yet... */
- tst_resm(TPASS,
- "fstatat() returned the expected errno %d: %s",
- TEST_ERRNO,
- strerror(TEST_ERRNO));
+ tst_resm(TPASS|TTERRNO,
+ "fstatat() failed as expected");
}
} else {
- TEST_ERROR_LOG(TEST_ERRNO);
- tst_resm(TFAIL,
- "fstatat() Failed, errno=%d : %s",
- TEST_ERRNO, strerror(TEST_ERRNO));
+ tst_resm(TFAIL|TTERRNO, "fstatat failed")
}
}
@@ -186,8 +163,7 @@
* cleanup and exit
***************************************************************/
cleanup();
-
- return (0);
+ tst_exit();
} /* End main */
void setup_every_copy()
@@ -201,32 +177,32 @@
ret = mkdir(pathname, 0700);
if (ret < 0) {
- perror("mkdir: ");
- exit(-1);
+ perror("mkdir");
+ exit(1);
}
dirfd = open(pathname, O_DIRECTORY);
if (dirfd < 0) {
- perror("open: ");
- exit(-1);
+ perror("open");
+ exit(1);
}
fd = open(testfile, O_CREAT | O_RDWR, 0600);
if (fd < 0) {
- perror("open: ");
- exit(-1);
+ perror("open");
+ exit(1);
}
fd = open(testfile2, O_CREAT | O_RDWR, 0600);
if (fd < 0) {
- perror("open: ");
- exit(-1);
+ perror("open");
+ exit(1);
}
fd = open(testfile3, O_CREAT | O_RDWR, 0600);
if (fd < 0) {
- perror("open: ");
- exit(-1);
+ perror("open");
+ exit(1);
}
fds[0] = fds[1] = fds[4] = dirfd;
@@ -249,7 +225,7 @@
/* Pause if that option was specified */
TEST_PAUSE;
-} /* End setup() */
+}
/***************************************************************
* cleanup() - performs all ONE TIME cleanup for this test at
@@ -268,7 +244,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
-} /* End cleanup() */
+}
diff --git a/testcases/kernel/syscalls/fstatfs/fstatfs01.c b/testcases/kernel/syscalls/fstatfs/fstatfs01.c
index ec9deb4..f703f77 100644
--- a/testcases/kernel/syscalls/fstatfs/fstatfs01.c
+++ b/testcases/kernel/syscalls/fstatfs/fstatfs01.c
@@ -140,7 +140,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fstatfs/fstatfs02.c b/testcases/kernel/syscalls/fstatfs/fstatfs02.c
index 88dc282..7498924 100644
--- a/testcases/kernel/syscalls/fstatfs/fstatfs02.c
+++ b/testcases/kernel/syscalls/fstatfs/fstatfs02.c
@@ -88,7 +88,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -127,7 +131,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/fsync/fsync01.c b/testcases/kernel/syscalls/fsync/fsync01.c
index 5c5303c..106f5a7 100644
--- a/testcases/kernel/syscalls/fsync/fsync01.c
+++ b/testcases/kernel/syscalls/fsync/fsync01.c
@@ -140,7 +140,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/fsync/fsync02.c b/testcases/kernel/syscalls/fsync/fsync02.c
index da91407..8b487ad 100644
--- a/testcases/kernel/syscalls/fsync/fsync02.c
+++ b/testcases/kernel/syscalls/fsync/fsync02.c
@@ -89,7 +89,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -158,7 +162,7 @@
close(fd);
sync();
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/fsync/fsync03.c b/testcases/kernel/syscalls/fsync/fsync03.c
index 4cc7860..91cd68b 100644
--- a/testcases/kernel/syscalls/fsync/fsync03.c
+++ b/testcases/kernel/syscalls/fsync/fsync03.c
@@ -82,7 +82,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -121,7 +125,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ftruncate/ftruncate01.c b/testcases/kernel/syscalls/ftruncate/ftruncate01.c
index effdbaa..294d1c2 100644
--- a/testcases/kernel/syscalls/ftruncate/ftruncate01.c
+++ b/testcases/kernel/syscalls/ftruncate/ftruncate01.c
@@ -99,7 +99,11 @@
off_t file_length; /* test file length */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -161,7 +165,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/ftruncate/ftruncate02.c b/testcases/kernel/syscalls/ftruncate/ftruncate02.c
index d684204..459a3b4 100644
--- a/testcases/kernel/syscalls/ftruncate/ftruncate02.c
+++ b/testcases/kernel/syscalls/ftruncate/ftruncate02.c
@@ -105,7 +105,11 @@
int err_flag = 0; /* error indicator flag */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -248,7 +252,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/ftruncate/ftruncate04.c b/testcases/kernel/syscalls/ftruncate/ftruncate04.c
index 02ecc23..6726aec 100644
--- a/testcases/kernel/syscalls/ftruncate/ftruncate04.c
+++ b/testcases/kernel/syscalls/ftruncate/ftruncate04.c
@@ -295,7 +295,7 @@
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
tst_resm(TBROK, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /* NOTREACHED */
+
}
#ifdef UCLINUX
maybe_run_child(&dochild, "dddd", filename, &recstart, &reclen, &ppid);
@@ -314,7 +314,7 @@
" not support mandatory locks. Cannot run this test.");
tst_rmdir();
tst_exit();
- /* NOTREACHED */
+
}
for (lc = 0; TEST_LOOPING(lc); lc++) {
setvbuf(stdin, 0, _IOLBF, BUFSIZ);
diff --git a/testcases/kernel/syscalls/futimesat/futimesat01.c b/testcases/kernel/syscalls/futimesat/futimesat01.c
index 504860d..91d8b5c 100644
--- a/testcases/kernel/syscalls/futimesat/futimesat01.c
+++ b/testcases/kernel/syscalls/futimesat/futimesat01.c
@@ -102,7 +102,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c b/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
index 509213a..c71f002 100644
--- a/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
+++ b/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
@@ -105,9 +105,6 @@
/* Remove tmp dir and all files in it */
TEST_CLEANUP;
tst_rmdir();
-
- /* Exit with appropriate return code. */
- tst_exit();
}
/* Local Functions */
@@ -138,7 +135,6 @@
/*
* Global variables
*/
-static int opt_debug;
static char *progname;
enum test_type {
@@ -351,11 +347,6 @@
if (tc->policy == MPOL_DEFAULT)
nodemask_zero(&nodemask);
cmp_ok = tc->policy == policy && (tc->from_node == NONE || nodemask_equal(&nodemask,&getnodemask));
- if (opt_debug) {
- nodemask_dump("nodemask Expect:", &nodemask);
- nodemask_dump("nodemask Result:", &getnodemask);
- tst_resm(TINFO,"policy E:%d R:%d", tc->policy, policy);
- }
TEST_END:
/*
* Check results
@@ -367,96 +358,40 @@
/*
- * usage()
- */
-
-void usage(const char *progname)
-{
- tst_resm(TINFO, "usage: %s [options]", progname);
- tst_resm(TINFO, "This is a regression test program of %s system call.", SYSCALL_NAME);
- tst_resm(TINFO, "options:");
- tst_resm(TINFO, " -d --debug Show debug messages");
- tst_resm(TINFO, " -h --help Show this message");
-
- tst_resm(TINFO,"NG");
- exit(1);
-}
-
-
-/*
* main()
*/
int main(int argc, char **argv) {
- int c, i, lc, ret;
- char *msg; /* message returned from parse_opts */
-
- struct option long_options[] = {
- { "debug", no_argument, 0, 'd' },
- { "help", no_argument, 0, 'h' },
- { NULL, 0, NULL, 0 }
- };
-
- progname = basename(argv[0]);
-
- /* parse standard options */
- if ((msg = parse_opts(argc, argv, NULL, NULL)) != NULL) {
- tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
+ int i, ret;
setup();
- /* Check looping state if -i option given */
- for (lc = 0; TEST_LOOPING(lc); lc++) {
+ ret = 0;
- Tst_count = 0;
-
- for (testno = 0; testno < TST_TOTAL; ++testno) {
-
- TEST(c = getopt_long(argc, argv, "dh", long_options, NULL));
-
- while (TEST_RETURN != -1) {
- switch (c) {
- case 'd':
- opt_debug = 1;
- break;
- default:
- usage(progname);
- // NOTREACHED
- }
- }
-
- /*
- * Execute test
- */
- for (i = 0; i < (int)(sizeof(tcase) / sizeof(*tcase)); i++) {
- tst_resm(TINFO, "(case%02d) START", i);
- ret = do_test(&tcase[i]);
- tst_resm((ret == 0 ? TPASS : TFAIL | TERRNO),
- "(case%02d) END", i);
- }
-
- }
-
+ /*
+ * Execute test
+ */
+ for (i = 0; ret == 0 && i < (int)(sizeof(tcase) / sizeof(*tcase));
+ i++) {
+ tst_resm(TINFO, "(case%02d) START", i);
+ ret = do_test(&tcase[i]);
+ tst_resm((ret == 0 ? TPASS : TFAIL|TERRNO), "(case%02d) END",
+ i);
}
cleanup();
tst_exit();
-
}
#else
int main(void) {
- tst_resm(TBROK, "XXX: test is broken on libnuma v2 (read numa_helpers.h for more details).");
- return 0;
+ tst_brkm(TBROK, NULL, "XXX: test is broken on libnuma v2 (read numa_helpers.h for more details).");
}
#endif
#else
int main(void) {
- tst_resm(TCONF, "System doesn't have required numa support");
- tst_exit();
+ tst_brkm(TCONF, NULL, "System doesn't have required numa support");
}
#endif
diff --git a/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c b/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c
index 730ffdd..d8adc48 100644
--- a/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c
+++ b/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c
@@ -82,7 +82,11 @@
size_t len_ptr; /* size of structure struct robust_list_head */
int retval;
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
diff --git a/testcases/kernel/syscalls/getcontext/getcontext01.c b/testcases/kernel/syscalls/getcontext/getcontext01.c
index 7566596..6370c82 100644
--- a/testcases/kernel/syscalls/getcontext/getcontext01.c
+++ b/testcases/kernel/syscalls/getcontext/getcontext01.c
@@ -63,7 +63,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/getcpu/getcpu01.c b/testcases/kernel/syscalls/getcpu/getcpu01.c
index 53effd8..f1db668 100644
--- a/testcases/kernel/syscalls/getcpu/getcpu01.c
+++ b/testcases/kernel/syscalls/getcpu/getcpu01.c
@@ -114,7 +114,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
setup(); /* global setup */
@@ -158,7 +162,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/getcwd/getcwd01.c b/testcases/kernel/syscalls/getcwd/getcwd01.c
index 0879578..19ab072 100644
--- a/testcases/kernel/syscalls/getcwd/getcwd01.c
+++ b/testcases/kernel/syscalls/getcwd/getcwd01.c
@@ -95,7 +95,11 @@
char *test_erg;
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -139,7 +143,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
void setup_test4()
diff --git a/testcases/kernel/syscalls/getcwd/getcwd02.c b/testcases/kernel/syscalls/getcwd/getcwd02.c
index cdfe509..2498430 100644
--- a/testcases/kernel/syscalls/getcwd/getcwd02.c
+++ b/testcases/kernel/syscalls/getcwd/getcwd02.c
@@ -92,7 +92,11 @@
char *msg; /* parse_opts() return message */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -105,11 +109,11 @@
if ((fin = popen(pwd, "r")) == NULL) {
tst_resm(TINFO, "%s: can't run %s", TCID, pwd);
tst_brkm(TBROK, cleanup, "%s FAILED", TCID);
- /*NOTREACHED*/}
+ }
while (fgets(pwd_buf, sizeof(pwd_buf), fin) != NULL) {
if ((cp = strchr(pwd_buf, '\n')) == NULL) {
tst_brkm(TBROK, cleanup, "pwd output too long");
- /*NOTREACHED*/}
+ }
*cp = 0;
cp_cur = pwd_buf;
}
@@ -124,7 +128,7 @@
do_block7();
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
void do_block1() //valid cwd[]: -> Should work fine
diff --git a/testcases/kernel/syscalls/getcwd/getcwd03.c b/testcases/kernel/syscalls/getcwd/getcwd03.c
index f58f6c3..cb9dbfc 100644
--- a/testcases/kernel/syscalls/getcwd/getcwd03.c
+++ b/testcases/kernel/syscalls/getcwd/getcwd03.c
@@ -83,7 +83,11 @@
char *msg; /* parse_opts() return message */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -103,10 +107,10 @@
sprintf(dir1, "getcwd1.%d", getpid());
if (mkdir(dir1, 00755) < 0) {
tst_brkm(TBROK, cleanup, "mkdir(2) failed");
- /*NOTREACHED*/}
+ }
if (chdir(dir1) != 0) {
tst_brkm(TBROK, cleanup, "chdir(2) failed");
- /*NOTREACHED*/}
+ }
pwd1 = getpwd();
if (getcwd(cwd1, sizeof cwd1) == NULL) {
@@ -118,7 +122,7 @@
tst_brkm(TFAIL, cleanup, "getcwd() returned unexpected "
"working directory: expected: %s, got: %s\n",
pwd1, cwd1);
- /*NOTREACHED*/}
+ }
tst_resm(TINFO, "getcwd(2) succeeded in returning correct path "
"for dir1");
@@ -134,12 +138,12 @@
if (symlink(dir1, dir2) < 0) {
tst_brkm(TBROK, cleanup, "symlink(2) failed: errno: %d",
errno);
- /*NOTREACHED*/}
+ }
if (chdir(dir2) != 0) {
tst_brkm(TBROK, cleanup, "chdir(2) failed: errno: %d",
errno);
- /*NOTREACHED*/}
+ }
pwd2 = getpwd();
if (getcwd(cwd2, sizeof cwd2) == NULL) {
@@ -153,7 +157,7 @@
((n = readlink(dir2, link2, sizeof(link2))) < 0)) {
tst_brkm(TBROK, cleanup, "readlink(2) failed: errno:%d",
errno);
- /*NOTREACHED*/}
+ }
/*
* Finally compare the pwd, cwd, link informations:
@@ -201,7 +205,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
void setup()
@@ -240,11 +244,11 @@
if ((fin = popen(pwd, "r")) == NULL) {
tst_resm(TINFO, "%s: can't run %s", TCID, pwd);
tst_brkm(TBROK, cleanup, "%s FAILED", TCID);
- /*NOTREACHED*/}
+ }
while (fgets(buf, BUFSIZ, fin) != NULL) {
if ((cp = strchr(buf, '\n')) == NULL) {
tst_brkm(TBROK, cleanup, "pwd output too long");
- /*NOTREACHED*/}
+ }
*cp = 0;
cp_cur = buf;
}
diff --git a/testcases/kernel/syscalls/getdents/getdents01.c b/testcases/kernel/syscalls/getdents/getdents01.c
index 32383bf..fbf2d43 100644
--- a/testcases/kernel/syscalls/getdents/getdents01.c
+++ b/testcases/kernel/syscalls/getdents/getdents01.c
@@ -95,7 +95,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -187,7 +191,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/getdents/getdents02.c b/testcases/kernel/syscalls/getdents/getdents02.c
index a17118c..8d4198f 100644
--- a/testcases/kernel/syscalls/getdents/getdents02.c
+++ b/testcases/kernel/syscalls/getdents/getdents02.c
@@ -93,7 +93,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -173,7 +177,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/getdents/getdents03.c b/testcases/kernel/syscalls/getdents/getdents03.c
index 9f6f348..39df308 100644
--- a/testcases/kernel/syscalls/getdents/getdents03.c
+++ b/testcases/kernel/syscalls/getdents/getdents03.c
@@ -96,7 +96,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -182,7 +186,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/getdents/getdents04.c b/testcases/kernel/syscalls/getdents/getdents04.c
index d97792d..ea5e490 100644
--- a/testcases/kernel/syscalls/getdents/getdents04.c
+++ b/testcases/kernel/syscalls/getdents/getdents04.c
@@ -98,7 +98,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -209,7 +213,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/getdomainname/getdomainname01.c b/testcases/kernel/syscalls/getdomainname/getdomainname01.c
index fcbc255..e3e8450 100644
--- a/testcases/kernel/syscalls/getdomainname/getdomainname01.c
+++ b/testcases/kernel/syscalls/getdomainname/getdomainname01.c
@@ -85,9 +85,15 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -118,7 +124,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/getegid/getegid01.c b/testcases/kernel/syscalls/getegid/getegid01.c
index 23207af..412ce42 100644
--- a/testcases/kernel/syscalls/getegid/getegid01.c
+++ b/testcases/kernel/syscalls/getegid/getegid01.c
@@ -138,7 +138,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/getegid/getegid02.c b/testcases/kernel/syscalls/getegid/getegid02.c
index a0211d2..bf119e9 100644
--- a/testcases/kernel/syscalls/getegid/getegid02.c
+++ b/testcases/kernel/syscalls/getegid/getegid02.c
@@ -83,8 +83,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup(); /* global setup */
@@ -129,7 +133,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/geteuid/geteuid01.c b/testcases/kernel/syscalls/geteuid/geteuid01.c
index 8301385..48bd4f7 100644
--- a/testcases/kernel/syscalls/geteuid/geteuid01.c
+++ b/testcases/kernel/syscalls/geteuid/geteuid01.c
@@ -138,7 +138,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/getgid/getgid01.c b/testcases/kernel/syscalls/getgid/getgid01.c
index 25b2939..03dfb86 100644
--- a/testcases/kernel/syscalls/getgid/getgid01.c
+++ b/testcases/kernel/syscalls/getgid/getgid01.c
@@ -136,7 +136,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/getgid/getgid03.c b/testcases/kernel/syscalls/getgid/getgid03.c
index a3ed6e2..f35c2a6 100644
--- a/testcases/kernel/syscalls/getgid/getgid03.c
+++ b/testcases/kernel/syscalls/getgid/getgid03.c
@@ -83,8 +83,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup(); /* global setup */
@@ -128,7 +132,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/getgroups/getgroups02.c b/testcases/kernel/syscalls/getgroups/getgroups02.c
index d87803d..dd0c51c 100644
--- a/testcases/kernel/syscalls/getgroups/getgroups02.c
+++ b/testcases/kernel/syscalls/getgroups/getgroups02.c
@@ -141,7 +141,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/getgroups/getgroups03.c b/testcases/kernel/syscalls/getgroups/getgroups03.c
index 464cc26..350859b 100644
--- a/testcases/kernel/syscalls/getgroups/getgroups03.c
+++ b/testcases/kernel/syscalls/getgroups/getgroups03.c
@@ -102,7 +102,11 @@
int gidsetsize = NGROUPS; /* total groups */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -151,7 +155,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/getgroups/getgroups04.c b/testcases/kernel/syscalls/getgroups/getgroups04.c
index 04cebfa..0bbcd10 100644
--- a/testcases/kernel/syscalls/getgroups/getgroups04.c
+++ b/testcases/kernel/syscalls/getgroups/getgroups04.c
@@ -108,7 +108,11 @@
char *test_desc; /* test specific error message */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -161,7 +165,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/gethostid/gethostid01.c b/testcases/kernel/syscalls/gethostid/gethostid01.c
index 3adf8b2..eeb5671 100644
--- a/testcases/kernel/syscalls/gethostid/gethostid01.c
+++ b/testcases/kernel/syscalls/gethostid/gethostid01.c
@@ -155,7 +155,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/gethostname/gethostname01.c b/testcases/kernel/syscalls/gethostname/gethostname01.c
index c9ff65c..68f6454 100644
--- a/testcases/kernel/syscalls/gethostname/gethostname01.c
+++ b/testcases/kernel/syscalls/gethostname/gethostname01.c
@@ -130,15 +130,9 @@
char hname[100]; /* host name */
- /***************************************************************
- * parse standard options
- ***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /***************************************************************
- * perform global setup for test
- ***************************************************************/
setup();
/* set the expected errnos... */
diff --git a/testcases/kernel/syscalls/getitimer/getitimer01.c b/testcases/kernel/syscalls/getitimer/getitimer01.c
index 4baca5f..1ba3e94 100644
--- a/testcases/kernel/syscalls/getitimer/getitimer01.c
+++ b/testcases/kernel/syscalls/getitimer/getitimer01.c
@@ -72,7 +72,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -121,7 +125,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/getitimer/getitimer02.c b/testcases/kernel/syscalls/getitimer/getitimer02.c
index 6270366..8a45f91 100644
--- a/testcases/kernel/syscalls/getitimer/getitimer02.c
+++ b/testcases/kernel/syscalls/getitimer/getitimer02.c
@@ -75,7 +75,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -117,7 +121,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/getitimer/getitimer03.c b/testcases/kernel/syscalls/getitimer/getitimer03.c
index 1e43f22..9237e5f 100644
--- a/testcases/kernel/syscalls/getitimer/getitimer03.c
+++ b/testcases/kernel/syscalls/getitimer/getitimer03.c
@@ -77,7 +77,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -135,7 +139,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/getpagesize/getpagesize01.c b/testcases/kernel/syscalls/getpagesize/getpagesize01.c
index 22cbf42..690526d 100644
--- a/testcases/kernel/syscalls/getpagesize/getpagesize01.c
+++ b/testcases/kernel/syscalls/getpagesize/getpagesize01.c
@@ -64,43 +64,25 @@
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /***************************************************************
- * perform global setup for test
- ***************************************************************/
setup();
/* set the expected errnos... */
TEST_EXP_ENOS(exp_enos);
- /***************************************************************
- * check looping state if -c option given
- ***************************************************************/
for (lc = 0; TEST_LOOPING(lc); lc++) {
/* reset Tst_count in case we are looping. */
Tst_count = 0;
- /*
- * TEST CASE:
- * Get page size
- */
- ;
-
/* Call getpagesize(2) */
TEST(getpagesize());
/* check return code */
if (TEST_RETURN == -1) {
- TEST_ERROR_LOG(TEST_ERRNO);
- tst_resm(TFAIL,
- "getpagesize - Get page size failed, errno=%d : %s",
- TEST_ERRNO, strerror(TEST_ERRNO));
+ tst_resm(TFAIL|TTERRNO, "getpagesize failed"),
continue; /* next loop for MTKERNEL */
}
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
if (STD_FUNCTIONAL_TEST) {
size = getpagesize();
tst_resm(TINFO, "Page Size is %d", size);
@@ -118,14 +100,10 @@
"getpagesize - Page size returned %d",
ret_sysconf);
}
- } /* End for TEST_LOOPING */
+ }
- /***************************************************************
- * cleanup and exit
- ***************************************************************/
cleanup();
-
- return 0;
+ tst_exit();
} /* End main */
/***************************************************************
@@ -151,7 +129,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
} /* End cleanup() */
diff --git a/testcases/kernel/syscalls/getpeername/getpeername01.c b/testcases/kernel/syscalls/getpeername/getpeername01.c
index aa7524d..dd73f42 100644
--- a/testcases/kernel/syscalls/getpeername/getpeername01.c
+++ b/testcases/kernel/syscalls/getpeername/getpeername01.c
@@ -113,7 +113,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -154,7 +158,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
void setup(void)
diff --git a/testcases/kernel/syscalls/getpgid/getpgid01.c b/testcases/kernel/syscalls/getpgid/getpgid01.c
index 50b079a..35b9c7a 100644
--- a/testcases/kernel/syscalls/getpgid/getpgid01.c
+++ b/testcases/kernel/syscalls/getpgid/getpgid01.c
@@ -69,7 +69,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
diff --git a/testcases/kernel/syscalls/getpgid/getpgid02.c b/testcases/kernel/syscalls/getpgid/getpgid02.c
index f1a0c84..5d58ad0 100644
--- a/testcases/kernel/syscalls/getpgid/getpgid02.c
+++ b/testcases/kernel/syscalls/getpgid/getpgid02.c
@@ -85,7 +85,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -123,7 +127,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/getpgrp/getpgrp01.c b/testcases/kernel/syscalls/getpgrp/getpgrp01.c
index 550b4ca..281ad99 100644
--- a/testcases/kernel/syscalls/getpgrp/getpgrp01.c
+++ b/testcases/kernel/syscalls/getpgrp/getpgrp01.c
@@ -135,7 +135,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/getpid/getpid02.c b/testcases/kernel/syscalls/getpid/getpid02.c
index 200e3d7..1888207 100644
--- a/testcases/kernel/syscalls/getpid/getpid02.c
+++ b/testcases/kernel/syscalls/getpid/getpid02.c
@@ -90,11 +90,8 @@
int status; /* exit status of child process */
/* Parse standard options given to run the test. */
- msg = parse_opts(ac, av, NULL, NULL);
- if (msg != NULL) {
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
/* Perform global setup for test */
setup();
@@ -104,19 +101,11 @@
/* Reset Tst_count in case we are looping. */
Tst_count = 0;
- /*
- * Invoke getpid() to get the process id of
- * the test process.
- */
TEST(getpid());
/* Save the process id returned by getpid() */
proc_id = TEST_RETURN;
- /*
- * Perform functional verification if test
- * executed without (-f) option.
- */
if (STD_FUNCTIONAL_TEST) {
/* Fork a child now */
if ((pid = FORK_OR_VFORK()) < 0) {
@@ -132,10 +121,13 @@
}
exit(0);
} else { /* parent process */
- wait(&status);
-
+ if (wait(&status) == -1) {
+ tst_brkm(TBROK|TERRNO, cleanup,
+ "wait failed");
+ }
/* Check exit status of child */
- if (WEXITSTATUS(status) != 0) {
+ if (WIFEXITED(status) &&
+ WEXITSTATUS(status) != 0) {
tst_resm(TFAIL, "getpid() returned "
"invalid pid %d", proc_id);
} else {
@@ -151,7 +143,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
/*
@@ -178,7 +170,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/getppid/getppid01.c b/testcases/kernel/syscalls/getppid/getppid01.c
index 9b0bf06..5edba06 100644
--- a/testcases/kernel/syscalls/getppid/getppid01.c
+++ b/testcases/kernel/syscalls/getppid/getppid01.c
@@ -135,7 +135,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/getppid/getppid02.c b/testcases/kernel/syscalls/getppid/getppid02.c
index fb327d7..7b43f71 100644
--- a/testcases/kernel/syscalls/getppid/getppid02.c
+++ b/testcases/kernel/syscalls/getppid/getppid02.c
@@ -62,7 +62,11 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -110,7 +114,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/getpriority/getpriority01.c b/testcases/kernel/syscalls/getpriority/getpriority01.c
index c41e204..10bbdfd 100644
--- a/testcases/kernel/syscalls/getpriority/getpriority01.c
+++ b/testcases/kernel/syscalls/getpriority/getpriority01.c
@@ -95,7 +95,11 @@
TST_TOTAL = sizeof(prio_which) / sizeof(int);
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -135,7 +139,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/getpriority/getpriority02.c b/testcases/kernel/syscalls/getpriority/getpriority02.c
index b349670..43dbd3b 100644
--- a/testcases/kernel/syscalls/getpriority/getpriority02.c
+++ b/testcases/kernel/syscalls/getpriority/getpriority02.c
@@ -114,7 +114,11 @@
uid_t who; /* process uid of the test process */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -173,7 +177,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/getresgid/getresgid01.c b/testcases/kernel/syscalls/getresgid/getresgid01.c
index 9475959..2abb3cf 100644
--- a/testcases/kernel/syscalls/getresgid/getresgid01.c
+++ b/testcases/kernel/syscalls/getresgid/getresgid01.c
@@ -87,7 +87,11 @@
eff_gid, sav_gid;
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -139,7 +143,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/getresgid/getresgid02.c b/testcases/kernel/syscalls/getresgid/getresgid02.c
index 27a6394..d12e937 100644
--- a/testcases/kernel/syscalls/getresgid/getresgid02.c
+++ b/testcases/kernel/syscalls/getresgid/getresgid02.c
@@ -97,7 +97,11 @@
eff_gid, sav_gid;
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -151,7 +155,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/getresgid/getresgid03.c b/testcases/kernel/syscalls/getresgid/getresgid03.c
index 8cb0984..b108203 100644
--- a/testcases/kernel/syscalls/getresgid/getresgid03.c
+++ b/testcases/kernel/syscalls/getresgid/getresgid03.c
@@ -98,7 +98,11 @@
eff_gid, sav_gid;
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -152,7 +156,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/getresuid/getresuid01.c b/testcases/kernel/syscalls/getresuid/getresuid01.c
index ae8ff88..7442107 100644
--- a/testcases/kernel/syscalls/getresuid/getresuid01.c
+++ b/testcases/kernel/syscalls/getresuid/getresuid01.c
@@ -92,7 +92,11 @@
eff_uid, sav_uid;
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -145,7 +149,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/getresuid/getresuid02.c b/testcases/kernel/syscalls/getresuid/getresuid02.c
index 24e0578..216cd73 100644
--- a/testcases/kernel/syscalls/getresuid/getresuid02.c
+++ b/testcases/kernel/syscalls/getresuid/getresuid02.c
@@ -97,7 +97,11 @@
eff_uid, sav_uid;
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -151,7 +155,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/getresuid/getresuid03.c b/testcases/kernel/syscalls/getresuid/getresuid03.c
index da7b2b4..6274245 100644
--- a/testcases/kernel/syscalls/getresuid/getresuid03.c
+++ b/testcases/kernel/syscalls/getresuid/getresuid03.c
@@ -97,7 +97,11 @@
eff_uid, sav_uid;
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -151,7 +155,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/getrusage/getrusage01.c b/testcases/kernel/syscalls/getrusage/getrusage01.c
index 5282a19..2faed98 100644
--- a/testcases/kernel/syscalls/getrusage/getrusage01.c
+++ b/testcases/kernel/syscalls/getrusage/getrusage01.c
@@ -86,9 +86,15 @@
struct rusage usage;
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -120,7 +126,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/getrusage/getrusage02.c b/testcases/kernel/syscalls/getrusage/getrusage02.c
index ce5df95..9f6219b 100644
--- a/testcases/kernel/syscalls/getrusage/getrusage02.c
+++ b/testcases/kernel/syscalls/getrusage/getrusage02.c
@@ -109,9 +109,15 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -147,7 +153,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/getsid/getsid01.c b/testcases/kernel/syscalls/getsid/getsid01.c
index 6ba6cc1..58994f6 100644
--- a/testcases/kernel/syscalls/getsid/getsid01.c
+++ b/testcases/kernel/syscalls/getsid/getsid01.c
@@ -80,7 +80,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -147,7 +151,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/getsid/getsid02.c b/testcases/kernel/syscalls/getsid/getsid02.c
index fbc75f2..abc791e 100644
--- a/testcases/kernel/syscalls/getsid/getsid02.c
+++ b/testcases/kernel/syscalls/getsid/getsid02.c
@@ -99,7 +99,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -138,7 +142,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/getsockname/getsockname01.c b/testcases/kernel/syscalls/getsockname/getsockname01.c
index 2616454..3527a6a 100644
--- a/testcases/kernel/syscalls/getsockname/getsockname01.c
+++ b/testcases/kernel/syscalls/getsockname/getsockname01.c
@@ -112,7 +112,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -146,7 +150,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
void setup(void)
diff --git a/testcases/kernel/syscalls/getsockopt/getsockopt01.c b/testcases/kernel/syscalls/getsockopt/getsockopt01.c
index aaa4374..9ea0c77 100644
--- a/testcases/kernel/syscalls/getsockopt/getsockopt01.c
+++ b/testcases/kernel/syscalls/getsockopt/getsockopt01.c
@@ -137,7 +137,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -173,7 +177,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
void setup(void)
diff --git a/testcases/kernel/syscalls/gettid/gettid01.c b/testcases/kernel/syscalls/gettid/gettid01.c
index 33e9adb..8cce12e 100644
--- a/testcases/kernel/syscalls/gettid/gettid01.c
+++ b/testcases/kernel/syscalls/gettid/gettid01.c
@@ -52,9 +52,8 @@
int lc; /* loop counter */
char *msg; /* parse_opts() return message */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
setup();
@@ -85,7 +84,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -112,8 +111,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
-
} /* End cleanup() */
diff --git a/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c b/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c
index bacff53..bc1fff2 100644
--- a/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c
+++ b/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c
@@ -72,7 +72,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -107,7 +111,7 @@
}
cleanup();
- /*NOTREACHED*/ return (0);
+ return (0);
}
/*
diff --git a/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c b/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c
index 7e7511b..00e0bc8 100644
--- a/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c
+++ b/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c
@@ -87,7 +87,11 @@
char *msg;
if ((msg = parse_opts(ac, av, opts, help)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
tst_sig(NOFORK, DEF_HANDLER, cleanup);
diff --git a/testcases/kernel/syscalls/getuid/getuid01.c b/testcases/kernel/syscalls/getuid/getuid01.c
index a157783..a9c5599 100644
--- a/testcases/kernel/syscalls/getuid/getuid01.c
+++ b/testcases/kernel/syscalls/getuid/getuid01.c
@@ -193,7 +193,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
} /* End cleanup() */
diff --git a/testcases/kernel/syscalls/getuid/getuid02.c b/testcases/kernel/syscalls/getuid/getuid02.c
index 7133d9d..fc1f358 100644
--- a/testcases/kernel/syscalls/getuid/getuid02.c
+++ b/testcases/kernel/syscalls/getuid/getuid02.c
@@ -60,9 +60,8 @@
char *msg; /* message returned by parse_opts */
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
setup();
diff --git a/testcases/kernel/syscalls/inotify/inotify01.c b/testcases/kernel/syscalls/inotify/inotify01.c
index fed89f8..f51c64a 100644
--- a/testcases/kernel/syscalls/inotify/inotify01.c
+++ b/testcases/kernel/syscalls/inotify/inotify01.c
@@ -49,8 +49,9 @@
#include <sys/syscall.h>
#include "test.h"
#include "usctest.h"
+#include "linux_syscall_numbers.h"
-#if defined(HAVE_SYS_INOTIFY_H) && defined(__NR_inotify_init)
+#if defined(HAVE_SYS_INOTIFY_H)
#include <sys/inotify.h>
#define EVENT_MAX 1024
@@ -119,64 +120,56 @@
* generate sequence of events
*/
if (chmod(fname, 0755) < 0) {
- tst_brkm(TBROK, cleanup,
- "chmod(%s, 0755) Failed, errno=%d : %s",
- fname, errno, strerror(errno));
+ tst_brkm(TBROK|TERRNO, cleanup,
+ "chmod(%s, 0755) failed", fname);
}
event_set[Tst_count] = IN_ATTRIB;
Tst_count++;
if ((fd = open(fname, O_RDONLY)) == -1) {
- tst_brkm(TBROK, cleanup,
- "open(%s, O_RDWR|O_CREAT,0700) Failed, errno=%d : %s",
- fname, errno, strerror(errno));
+ tst_brkm(TBROK|TERRNO, cleanup,
+ "open(%s, O_RDWR|O_CREAT,0700) failed", fname);
}
event_set[Tst_count] = IN_OPEN;
Tst_count++;
if (read(fd, buf, BUF_SIZE) == -1) {
- tst_brkm(TBROK, cleanup,
- "read(%d, buf, %d) Failed, errno=%d : %s",
- fd, BUF_SIZE, errno, strerror(errno));
+ tst_brkm(TBROK|TERRNO, cleanup,
+ "read(%d, buf, %d) failed", fd, BUF_SIZE);
}
event_set[Tst_count] = IN_ACCESS;
Tst_count++;
if (close(fd) == -1) {
- tst_brkm(TBROK, cleanup,
- "close(%s) Failed, errno=%d : %s",
- fname, errno, strerror(errno));
+ tst_brkm(TBROK, cleanup, "close(%s) failed", fname);
}
event_set[Tst_count] = IN_CLOSE_NOWRITE;
Tst_count++;
if ((fd = open(fname, O_RDWR | O_CREAT, 0700)) == -1) {
tst_brkm(TBROK, cleanup,
- "open(%s, O_RDWR|O_CREAT,0700) Failed, errno=%d : %s",
- fname, errno, strerror(errno));
+ "open(%s, O_RDWR|O_CREAT,0700) failed", fname);
}
event_set[Tst_count] = IN_OPEN;
Tst_count++;
if (write(fd, buf, BUF_SIZE) == -1) {
tst_brkm(TBROK, cleanup,
- "write(%d, %s, 1) Failed, errno=%d : %s",
- fd, fname, errno, strerror(errno));
+ "write(%d, %s, 1) failed", fd, fname);
}
event_set[Tst_count] = IN_MODIFY;
Tst_count++;
if (close(fd) == -1) {
tst_brkm(TBROK, cleanup,
- "close(%s) Failed, errno=%d : %s",
- fname, errno, strerror(errno));
+ "close(%s) failed", fname);
}
event_set[Tst_count] = IN_CLOSE_WRITE;
Tst_count++;
if (TST_TOTAL != Tst_count) {
tst_brkm(TBROK, cleanup,
- "TST_TOTAL and Tst_count are not equal");
+ "TST_TOTAL and Tst_count are not equal");
}
Tst_count = 0;
@@ -186,9 +179,8 @@
int len, i = 0, test_num = 0;
if ((len = read(fd_notify, event_buf, EVENT_BUF_LEN)) < 0) {
tst_brkm(TBROK, cleanup,
- "read(%d, buf, %d) Failed, errno=%d : %s",
- fd_notify, EVENT_BUF_LEN, errno,
- strerror(errno));
+ "read(%d, buf, %d) failed",
+ fd_notify, EVENT_BUF_LEN);
}
@@ -221,8 +213,8 @@
i += EVENT_SIZE + event->len;
}
for (; test_num < TST_TOTAL; test_num++) {
- tst_resm(TFAIL, "don't get event: mask=%x ",
- event_set[test_num]);
+ tst_resm(TFAIL, "didn't get event: mask=%x",
+ event_set[test_num]);
}
@@ -253,16 +245,13 @@
fname);
}
if ((write(fd, fname, 1)) == -1) {
- tst_brkm(TBROK|TERRNO, cleanup,
- "write(%d, %s, 1) failed",
- fd, fname);
+ tst_brkm(TBROK|TERRNO, cleanup, "write(%d, %s, 1) failed",
+ fd, fname);
}
/* close the file we have open */
if (close(fd) == -1) {
- tst_brkm(TBROK, cleanup,
- "close(%s) failed",
- fname);
+ tst_brkm(TBROK, cleanup, "close(%s) failed", fname);
}
if ((fd_notify = myinotify_init()) < 0) {
if (errno == ENOSYS) {
@@ -275,8 +264,8 @@
if ((wd = myinotify_add_watch(fd_notify, fname, IN_ALL_EVENTS)) < 0) {
tst_brkm(TBROK|TERRNO, cleanup,
- "inotify_add_watch (%d, %s, IN_ALL_EVENTS) failed",
- fd_notify, fname);
+ "inotify_add_watch (%d, %s, IN_ALL_EVENTS) failed",
+ fd_notify, fname);
};
} /* End setup() */
@@ -314,17 +303,7 @@
int main(void)
{
-#ifndef __NR_inotify_init
- tst_resm(TCONF, "This test needs a kernel that has inotify syscall.");
- tst_resm(TCONF,
- "Inotify syscall can be found at kernel 2.6.13 or higher.");
- return 0;
-#endif
-#ifndef HAVE_SYS_INOTIFY_H
- tst_resm(TBROK, "can't find header sys/inotify.h");
- return 1;
-#endif
- return 0;
+ tst_brkm(TCONF, NULL, "system doesn't have required inotify support");
}
#endif
diff --git a/testcases/kernel/syscalls/inotify/inotify02.c b/testcases/kernel/syscalls/inotify/inotify02.c
index 3aee5d2..8c26912 100644
--- a/testcases/kernel/syscalls/inotify/inotify02.c
+++ b/testcases/kernel/syscalls/inotify/inotify02.c
@@ -53,8 +53,9 @@
#include <sys/syscall.h>
#include "test.h"
#include "usctest.h"
+#include "linux_syscall_numbers.h"
-#if defined(__NR_inotify_init) && defined(HAVE_SYS_INOTIFY_H)
+#if defined(HAVE_SYS_INOTIFY_H)
#include <sys/inotify.h>
#ifndef IN_MOVE_SELF
@@ -135,7 +136,7 @@
* generate sequence of events
*/
if (chmod(".", 0755) < 0) {
- tst_brkm(TBROK, cleanup,
+ tst_brkm(TBROK|TERRNO, cleanup,
"chmod(\".\", 0755) failed");
}
event_set[Tst_count].mask = IN_ISDIR | IN_ATTRIB;
@@ -143,7 +144,7 @@
Tst_count++;
if ((fd = creat(FILE_NAME1, 0755)) == -1) {
- tst_brkm(TBROK, cleanup,
+ tst_brkm(TBROK|TERRNO, cleanup,
"creat(\"%s\", 755) failed",
FILE_NAME1);
}
@@ -156,7 +157,7 @@
Tst_count++;
if (close(fd) == -1) {
- tst_brkm(TBROK, cleanup,
+ tst_brkm(TBROK|TERRNO, cleanup,
"close(%s) failed", FILE_NAME1);
}
event_set[Tst_count].mask = IN_CLOSE_WRITE;
@@ -164,7 +165,7 @@
Tst_count++;
if (rename(FILE_NAME1, FILE_NAME2) == -1) {
- tst_brkm(TBROK, cleanup,
+ tst_brkm(TBROK|TERRNO, cleanup,
"rename(%s, %s) failed",
FILE_NAME1, FILE_NAME2);
}
@@ -176,14 +177,14 @@
Tst_count++;
if (getcwd(fname1, BUF_SIZE) == NULL) {
- tst_brkm(TBROK | TERRNO, cleanup,
+ tst_brkm(TBROK|TERRNO, cleanup,
"getcwd(%p, %d) failed", fname1,
BUF_SIZE);
}
snprintf(fname2, BUF_SIZE, "%s.rename1", fname1);
if (rename(fname1, fname2) == -1) {
- tst_brkm(TBROK, cleanup,
+ tst_brkm(TBROK|TERRNO, cleanup,
"rename(%s, %s) failed", fname1, fname2);
}
event_set[Tst_count].mask = IN_MOVE_SELF;
@@ -191,7 +192,7 @@
Tst_count++;
if (unlink(FILE_NAME2) == -1) {
- tst_brkm(TBROK, cleanup,
+ tst_brkm(TBROK|TERRNO, cleanup,
"unlink(%s) failed", FILE_NAME2);
}
event_set[Tst_count].mask = IN_DELETE;
@@ -206,12 +207,12 @@
*/
snprintf(fname3, BUF_SIZE, "%s.rename2", fname1);
if (rename(fname2, fname3) == -1) {
- tst_brkm(TBROK, cleanup,
+ tst_brkm(TBROK|TERRNO, cleanup,
"rename(%s, %s) failed", fname2, fname3);
}
if (rename(fname3, fname1) == -1) {
- tst_brkm(TBROK, cleanup,
+ tst_brkm(TBROK|TERRNO, cleanup,
"rename(%s, %s) failed", fname3, fname1);
}
event_set[Tst_count].mask = IN_MOVE_SELF;
@@ -226,8 +227,8 @@
Tst_count = 0;
int len, i = 0, test_num = 0;
- if ((len = read(fd_notify, event_buf, EVENT_BUF_LEN)) < 0) {
- tst_brkm(TBROK, cleanup,
+ if ((len = read(fd_notify, event_buf, EVENT_BUF_LEN)) == -1) {
+ tst_brkm(TBROK|TERRNO, cleanup,
"read(%d, buf, %d) failed",
fd_notify, EVENT_BUF_LEN);
@@ -361,17 +362,7 @@
int main(void)
{
-#ifndef __NR_inotify_init
- tst_resm(TCONF, "This test needs a kernel that has inotify syscall.");
- tst_resm(TCONF,
- "Inotify syscall can be found at kernel 2.6.13 or higher.");
- return 0;
-#endif
-#ifndef HAVE_SYS_INOTIFY_H
- tst_resm(TBROK, "can't find header sys/inotify.h");
- return 1;
-#endif
- return 0;
+ tst_brkm(TCONF, NULL, "system doesn't have required inotify support");
}
#endif
diff --git a/testcases/kernel/syscalls/inotify/inotify03.c b/testcases/kernel/syscalls/inotify/inotify03.c
index b25c08d..45cf617 100644
--- a/testcases/kernel/syscalls/inotify/inotify03.c
+++ b/testcases/kernel/syscalls/inotify/inotify03.c
@@ -48,8 +48,9 @@
#include <signal.h>
#include "test.h"
#include "usctest.h"
+#include "linux_syscall_numbers.h"
-#if defined(HAVE_SYS_INOTIFY_H) && defined(__NR_inotify_init)
+#if defined(HAVE_SYS_INOTIFY_H)
#include <sys/inotify.h>
#define EVENT_MAX 1024
@@ -115,7 +116,7 @@
int len, i, test_num;
/* parse standard options */
- if ((msg = parse_opts(ac, av, (option_t *) options, &help)) != NULL)
+ if ((msg = parse_opts(ac, av, options, &help)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
/* Check for mandatory option of the testcase */
@@ -283,8 +284,7 @@
tst_brkm(TCONF, cleanup,
"inotify is not configured in this kernel.");
} else {
- tst_brkm(TBROK|TERRNO, cleanup,
- "inotify_init() failed");
+ tst_brkm(TBROK|TERRNO, cleanup, "inotify_init failed");
}
}
@@ -311,7 +311,7 @@
if (mount_flag) {
TEST(umount(mntpoint));
if (TEST_RETURN != 0) {
- tst_resm(TWARN|TTERRNO, "umount(2) failed ");
+ tst_resm(TWARN|TTERRNO, "umount(%s) failed", mntpoint);
}
}
@@ -342,17 +342,7 @@
int main()
{
-#ifndef __NR_inotify_init
- tst_resm(TCONF, "This test needs a kernel that has inotify syscall.");
- tst_resm(TCONF,
- "Inotify syscall can be found at kernel 2.6.13 or higher.");
- return 0;
-#endif
-#ifndef HAVE_SYS_INOTIFY_H
- tst_resm(TBROK, "can't find header sys/inotify.h");
- return 1;
-#endif
- return 0;
+ tst_brkm(TCONF, NULL, "system doesn't have required inotify support");
}
#endif
diff --git a/testcases/kernel/syscalls/inotify_init/inotify_init1_01.c b/testcases/kernel/syscalls/inotify_init/inotify_init1_01.c
index 4df90ef..d7bb0e1 100644
--- a/testcases/kernel/syscalls/inotify_init/inotify_init1_01.c
+++ b/testcases/kernel/syscalls/inotify_init/inotify_init1_01.c
@@ -137,7 +137,12 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
if ((msg = parse_opts(argc, argv, NULL, NULL)) != NULL)
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+>>>>>>> master
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
if ((tst_kvercmp(2, 6, 27)) < 0) {
tst_brkm(TCONF, NULL,
diff --git a/testcases/kernel/syscalls/inotify_init/inotify_init1_02.c b/testcases/kernel/syscalls/inotify_init/inotify_init1_02.c
index 87841be..eacdc95 100644
--- a/testcases/kernel/syscalls/inotify_init/inotify_init1_02.c
+++ b/testcases/kernel/syscalls/inotify_init/inotify_init1_02.c
@@ -134,7 +134,12 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
if ((msg = parse_opts(argc, argv, NULL, NULL)) != NULL)
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+>>>>>>> master
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
if ((tst_kvercmp(2, 6, 27)) < 0) {
tst_brkm(TCONF, NULL,
diff --git a/testcases/kernel/syscalls/io_cancel/io_cancel01.c b/testcases/kernel/syscalls/io_cancel/io_cancel01.c
index 5fd9c10..0cbcc5f 100644
--- a/testcases/kernel/syscalls/io_cancel/io_cancel01.c
+++ b/testcases/kernel/syscalls/io_cancel/io_cancel01.c
@@ -73,8 +73,12 @@
if ((msg =
parse_opts(argc, argv, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup();
diff --git a/testcases/kernel/syscalls/io_destroy/io_destroy01.c b/testcases/kernel/syscalls/io_destroy/io_destroy01.c
index 221b952..140a125 100644
--- a/testcases/kernel/syscalls/io_destroy/io_destroy01.c
+++ b/testcases/kernel/syscalls/io_destroy/io_destroy01.c
@@ -73,8 +73,12 @@
if ((msg =
parse_opts(argc, argv, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup();
diff --git a/testcases/kernel/syscalls/io_getevents/io_getevents01.c b/testcases/kernel/syscalls/io_getevents/io_getevents01.c
index a6f7870..91a8509 100644
--- a/testcases/kernel/syscalls/io_getevents/io_getevents01.c
+++ b/testcases/kernel/syscalls/io_getevents/io_getevents01.c
@@ -73,8 +73,12 @@
if ((msg =
parse_opts(argc, argv, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup();
diff --git a/testcases/kernel/syscalls/io_setup/io_setup01.c b/testcases/kernel/syscalls/io_setup/io_setup01.c
index 64b610d..4aeee64 100644
--- a/testcases/kernel/syscalls/io_setup/io_setup01.c
+++ b/testcases/kernel/syscalls/io_setup/io_setup01.c
@@ -46,8 +46,6 @@
* print errno log if that option was specified
*/
TEST_CLEANUP;
-
- tst_exit();
}
/*
@@ -71,10 +69,8 @@
io_context_t ctx;
int expected_return;
- if ((msg =
- parse_opts(argc, argv, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(argc, argv, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
setup();
diff --git a/testcases/kernel/syscalls/io_submit/io_submit01.c b/testcases/kernel/syscalls/io_submit/io_submit01.c
index 3e24cb4..c581a14 100644
--- a/testcases/kernel/syscalls/io_submit/io_submit01.c
+++ b/testcases/kernel/syscalls/io_submit/io_submit01.c
@@ -78,8 +78,12 @@
if ((msg =
parse_opts(argc, argv, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup();
@@ -175,7 +179,7 @@
rval = io_setup(1, &ctx);
if (rval != 0) {
tst_brkm(TBROK, cleanup, "io_setup failed: %d", rval);
- /*NOTREACHED*/}
+ }
TEST(io_submit(ctx, 1, iocbs));
if (TEST_RETURN == 0) {
diff --git a/testcases/kernel/syscalls/ioctl/ioctl01.c b/testcases/kernel/syscalls/ioctl/ioctl01.c
index def5bb1..b083529 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl01.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl01.c
@@ -115,7 +115,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, options, &help)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
if (!Devflag) {
@@ -126,7 +130,7 @@
}
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
setup();
@@ -168,7 +172,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
diff --git a/testcases/kernel/syscalls/ioctl/ioctl02.c b/testcases/kernel/syscalls/ioctl/ioctl02.c
index e43adf5..f9f772d 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl02.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl02.c
@@ -114,7 +114,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, options, &help)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child_uclinux, "dS", &parentpid, &childtty);
@@ -128,7 +132,7 @@
}
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
setup();
@@ -146,7 +150,7 @@
if ((childpid = FORK_OR_VFORK()) < 0) {
tst_brkm(TBROK, cleanup, "fork() failed");
- /*NOTREACHED*/}
+ }
if (childpid == 0) { /* child */
#ifdef UCLINUX
@@ -169,7 +173,7 @@
kill(childpid, SIGTERM);
waitpid(childpid, NULL, 0);
cleanup();
- /*NOTREACHED*/}
+ }
/* run the parent test */
if ((rval = run_ptest()) == -1) {
@@ -210,7 +214,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
void do_child()
diff --git a/testcases/kernel/syscalls/ioperm/ioperm01.c b/testcases/kernel/syscalls/ioperm/ioperm01.c
index fe9162c..9a59304 100644
--- a/testcases/kernel/syscalls/ioperm/ioperm01.c
+++ b/testcases/kernel/syscalls/ioperm/ioperm01.c
@@ -95,9 +95,15 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -128,7 +134,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -141,8 +147,8 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Must be root for this test!");
- /*NOTREACHED*/}
+ tst_brkm(TBROK, NULL, "Must be root for this test!");
+ }
/*
* The value of IO_BITMAP_BITS (include/asm-i386/processor.h) changed
@@ -174,7 +180,7 @@
* Reset I/O privileges for the specified port.
*/
if ((ioperm(io_addr, NUM_BYTES, TURN_OFF)) == -1) {
- tst_brkm(TBROK, tst_exit, "ioperm() cleanup failed");
+ tst_brkm(TBROK, NULL, "ioperm() cleanup failed");
}
/*
diff --git a/testcases/kernel/syscalls/ioperm/ioperm02.c b/testcases/kernel/syscalls/ioperm/ioperm02.c
index 85b4fd8..aa2aa7d 100644
--- a/testcases/kernel/syscalls/ioperm/ioperm02.c
+++ b/testcases/kernel/syscalls/ioperm/ioperm02.c
@@ -116,9 +116,15 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -173,7 +179,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -194,7 +200,7 @@
{
/* reset user as root */
if (seteuid(0) == -1) {
- tst_brkm(TBROK, tst_exit, "Failed to set uid as root");
+ tst_brkm(TBROK, NULL, "Failed to set uid as root");
}
}
@@ -207,12 +213,12 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Must be root for this test!");
+ tst_brkm(TBROK, NULL, "Must be root for this test!");
}
/* Check if "nobody" user id exists */
if ((ltpuser = getpwnam(nobody_uid)) == NULL) {
- tst_brkm(TBROK, tst_exit, "\"nobody\" user id doesn't exist");
+ tst_brkm(TBROK, NULL, "\"nobody\" user id doesn't exist");
}
/*
diff --git a/testcases/kernel/syscalls/iopl/iopl01.c b/testcases/kernel/syscalls/iopl/iopl01.c
index eaac071..7048cc3 100644
--- a/testcases/kernel/syscalls/iopl/iopl01.c
+++ b/testcases/kernel/syscalls/iopl/iopl01.c
@@ -89,10 +89,8 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL))
- != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/* perform global setup for test */
setup();
@@ -139,8 +137,8 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Must be root for this test!");
- /*NOTREACHED*/}
+ tst_brkm(TBROK, NULL, "Must be root for this test!");
+ }
/* Pause if that option was specified */
TEST_PAUSE;
diff --git a/testcases/kernel/syscalls/iopl/iopl02.c b/testcases/kernel/syscalls/iopl/iopl02.c
index 3763524..7efa5b0 100644
--- a/testcases/kernel/syscalls/iopl/iopl02.c
+++ b/testcases/kernel/syscalls/iopl/iopl02.c
@@ -188,7 +188,7 @@
{
/* reset user as root */
if (seteuid(0) == -1) {
- tst_brkm(TBROK, tst_exit, "Failed to set uid as root");
+ tst_brkm(TBROK, NULL, "Failed to set uid as root");
}
}
@@ -201,12 +201,12 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Must be root for this test!");
+ tst_brkm(TBROK, NULL, "Must be root for this test!");
}
/* Check if "nobody" user id exists */
if ((ltpuser = getpwnam(nobody_uid)) == NULL) {
- tst_brkm(TBROK, tst_exit, "\"nobody\" user id doesn't exist");
+ tst_brkm(TBROK, NULL, "\"nobody\" user id doesn't exist");
}
/* Set up the expected error numbers for -e option */
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl01.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl01.c
index 72c42be..5cf2d66 100644
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl01.c
+++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl01.c
@@ -76,7 +76,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -117,7 +121,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl02.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl02.c
index bc6f16f..a9e687d 100644
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl02.c
+++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl02.c
@@ -78,7 +78,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -131,7 +135,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl03.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl03.c
index 9e8e3a7..121e29f 100644
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl03.c
+++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl03.c
@@ -74,7 +74,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -111,7 +115,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl04.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl04.c
index a1d8ca5..783b09a 100644
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl04.c
+++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl04.c
@@ -110,7 +110,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -148,7 +152,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -169,7 +173,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1)
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c
index 7eead0d..5de0144 100644
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c
+++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c
@@ -82,7 +82,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl08.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl08.c
index bf75a3d..cac5d6b 100644
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl08.c
+++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl08.c
@@ -123,7 +123,11 @@
/* parse standard options */
if ((msg =
parse_opts(argc, argv, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
maybe_run_child(&do_child_1_uclinux, "ndd", 1, &key_uclinux,
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl09.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl09.c
index e454dd9..17aa706 100644
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl09.c
+++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl09.c
@@ -127,7 +127,11 @@
/* parse standard options */
if ((msg =
parse_opts(argc, argv, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
maybe_run_child(&do_child_1_uclinux, "ndd", 1, &key_uclinux,
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c
index 1ad2506..4ea4e0d 100644
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c
+++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c
@@ -120,7 +120,11 @@
/* parse standard options */
if ((msg =
parse_opts(argc, argv, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
maybe_run_child(&do_child_1_uclinux, "ndd", 1, &key_uclinux,
@@ -452,7 +456,11 @@
cleanup();
MSGMNI = nr_msgqs - get_used_msgqueues();
+<<<<<<< HEAD
if (MSGMNI > MAXNPROCS)
+=======
+ if ( MSGMNI > MAXNPROCS )
+>>>>>>> master
MSGMNI = MAXNPROCS;
if (MSGMNI <= 0) {
tst_resm(TBROK,
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl11.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl11.c
index 5dd6b2b..bf74033 100644
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl11.c
+++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl11.c
@@ -130,7 +130,11 @@
/* parse standard options */
if ((msg =
parse_opts(argc, argv, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
maybe_run_child(&do_child_1_uclinux, "ndd", 1, &key_uclinux,
diff --git a/testcases/kernel/syscalls/ipc/msgget/msgget01.c b/testcases/kernel/syscalls/ipc/msgget/msgget01.c
index 55977ea..ef3c999 100644
--- a/testcases/kernel/syscalls/ipc/msgget/msgget01.c
+++ b/testcases/kernel/syscalls/ipc/msgget/msgget01.c
@@ -73,7 +73,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -119,7 +123,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/msgget/msgget02.c b/testcases/kernel/syscalls/ipc/msgget/msgget02.c
index 85b2481..7bba407 100644
--- a/testcases/kernel/syscalls/ipc/msgget/msgget02.c
+++ b/testcases/kernel/syscalls/ipc/msgget/msgget02.c
@@ -91,7 +91,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -141,7 +145,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/msgget/msgget03.c b/testcases/kernel/syscalls/ipc/msgget/msgget03.c
index 9337381..6a5a9f6 100644
--- a/testcases/kernel/syscalls/ipc/msgget/msgget03.c
+++ b/testcases/kernel/syscalls/ipc/msgget/msgget03.c
@@ -76,7 +76,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -119,7 +123,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/msgget/msgget04.c b/testcases/kernel/syscalls/ipc/msgget/msgget04.c
index 2dff025..7f69c8a 100644
--- a/testcases/kernel/syscalls/ipc/msgget/msgget04.c
+++ b/testcases/kernel/syscalls/ipc/msgget/msgget04.c
@@ -79,7 +79,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -125,7 +129,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -144,7 +148,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv01.c b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv01.c
index 1b0db9e..99dbfce 100644
--- a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv01.c
+++ b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv01.c
@@ -87,7 +87,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child, "d", &msg_q_1);
diff --git a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv02.c b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv02.c
index 5d3ad75..0fd5209 100644
--- a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv02.c
+++ b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv02.c
@@ -101,7 +101,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -142,7 +146,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -163,7 +167,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv03.c b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv03.c
index cb66d44..677a2a2 100644
--- a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv03.c
+++ b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv03.c
@@ -89,7 +89,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -130,7 +134,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv04.c b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv04.c
index 50cf94b..e1ad660 100644
--- a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv04.c
+++ b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv04.c
@@ -100,7 +100,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -141,7 +145,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv05.c b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv05.c
index e7d92f3..68869c4 100644
--- a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv05.c
+++ b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv05.c
@@ -93,7 +93,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child_uclinux, "d", &msg_q_1);
@@ -158,7 +162,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv06.c b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv06.c
index a82582e..819c1a8 100644
--- a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv06.c
+++ b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv06.c
@@ -95,7 +95,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child_uclinux, "d", &msg_q_1);
@@ -164,7 +168,7 @@
}
}
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd01.c b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd01.c
index 3f71353..1001d55 100644
--- a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd01.c
+++ b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd01.c
@@ -81,7 +81,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -136,7 +140,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd02.c b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd02.c
index fd6a7ab..6fe5ee5 100644
--- a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd02.c
+++ b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd02.c
@@ -92,7 +92,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -130,7 +134,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -149,7 +153,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd03.c b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd03.c
index 5942b26..71b31d2 100644
--- a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd03.c
+++ b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd03.c
@@ -98,7 +98,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -142,7 +146,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd04.c b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd04.c
index 1b62426..f0c82c4 100644
--- a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd04.c
+++ b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd04.c
@@ -76,7 +76,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -115,7 +119,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd05.c b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd05.c
index 526e1d2..a027fa6 100644
--- a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd05.c
+++ b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd05.c
@@ -97,7 +97,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child_uclinux, "d", &msg_q_1);
@@ -162,7 +166,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd06.c b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd06.c
index 68dac6b..8de4457 100644
--- a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd06.c
+++ b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd06.c
@@ -91,7 +91,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
#define PIPE_NAME "msgsnd06"
@@ -172,7 +176,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/semctl/semctl01.c b/testcases/kernel/syscalls/ipc/semctl/semctl01.c
index 6f901a3..f226a75 100644
--- a/testcases/kernel/syscalls/ipc/semctl/semctl01.c
+++ b/testcases/kernel/syscalls/ipc/semctl/semctl01.c
@@ -147,7 +147,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
argv0 = av[0];
@@ -249,7 +253,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
diff --git a/testcases/kernel/syscalls/ipc/semctl/semctl02.c b/testcases/kernel/syscalls/ipc/semctl/semctl02.c
index b005f05..5852643 100644
--- a/testcases/kernel/syscalls/ipc/semctl/semctl02.c
+++ b/testcases/kernel/syscalls/ipc/semctl/semctl02.c
@@ -74,7 +74,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -114,7 +118,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -133,7 +137,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/ipc/semctl/semctl03.c b/testcases/kernel/syscalls/ipc/semctl/semctl03.c
index b03823b..a53245b 100644
--- a/testcases/kernel/syscalls/ipc/semctl/semctl03.c
+++ b/testcases/kernel/syscalls/ipc/semctl/semctl03.c
@@ -104,7 +104,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -140,7 +144,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/semctl/semctl04.c b/testcases/kernel/syscalls/ipc/semctl/semctl04.c
index 1379073..59ca88e 100644
--- a/testcases/kernel/syscalls/ipc/semctl/semctl04.c
+++ b/testcases/kernel/syscalls/ipc/semctl/semctl04.c
@@ -83,7 +83,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
diff --git a/testcases/kernel/syscalls/ipc/semctl/semctl05.c b/testcases/kernel/syscalls/ipc/semctl/semctl05.c
index 18196b0..63291a1 100644
--- a/testcases/kernel/syscalls/ipc/semctl/semctl05.c
+++ b/testcases/kernel/syscalls/ipc/semctl/semctl05.c
@@ -103,7 +103,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -143,7 +147,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/semctl/semctl06.c b/testcases/kernel/syscalls/ipc/semctl/semctl06.c
index d99a378..644e83a 100644
--- a/testcases/kernel/syscalls/ipc/semctl/semctl06.c
+++ b/testcases/kernel/syscalls/ipc/semctl/semctl06.c
@@ -116,7 +116,11 @@
char *msg;
if ((msg =
parse_opts(argc, argv, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
argv0 = argv[0];
diff --git a/testcases/kernel/syscalls/ipc/semget/semget01.c b/testcases/kernel/syscalls/ipc/semget/semget01.c
index 6d31fde..3899869 100644
--- a/testcases/kernel/syscalls/ipc/semget/semget01.c
+++ b/testcases/kernel/syscalls/ipc/semget/semget01.c
@@ -72,7 +72,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -115,7 +119,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/semget/semget02.c b/testcases/kernel/syscalls/ipc/semget/semget02.c
index 1ddf5c0..3f18f2c 100644
--- a/testcases/kernel/syscalls/ipc/semget/semget02.c
+++ b/testcases/kernel/syscalls/ipc/semget/semget02.c
@@ -85,7 +85,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -122,7 +126,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -132,7 +136,7 @@
{
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (seteuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/ipc/semget/semget03.c b/testcases/kernel/syscalls/ipc/semget/semget03.c
index 69eefba..388055f 100644
--- a/testcases/kernel/syscalls/ipc/semget/semget03.c
+++ b/testcases/kernel/syscalls/ipc/semget/semget03.c
@@ -67,7 +67,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -104,7 +108,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/semget/semget05.c b/testcases/kernel/syscalls/ipc/semget/semget05.c
index 88c7496..2b5c149 100644
--- a/testcases/kernel/syscalls/ipc/semget/semget05.c
+++ b/testcases/kernel/syscalls/ipc/semget/semget05.c
@@ -81,7 +81,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Set the MAXIDS for the specific machine by reading the system limit
@@ -132,7 +136,7 @@
cleanup();
- /*NOTREACHED*/ return (0);
+ return (0);
}
/*
diff --git a/testcases/kernel/syscalls/ipc/semget/semget06.c b/testcases/kernel/syscalls/ipc/semget/semget06.c
index ebe1c09..c84fc7a 100644
--- a/testcases/kernel/syscalls/ipc/semget/semget06.c
+++ b/testcases/kernel/syscalls/ipc/semget/semget06.c
@@ -73,7 +73,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -114,7 +118,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/semop/semop01.c b/testcases/kernel/syscalls/ipc/semop/semop01.c
index 4dddc25..7b0d612 100644
--- a/testcases/kernel/syscalls/ipc/semop/semop01.c
+++ b/testcases/kernel/syscalls/ipc/semop/semop01.c
@@ -83,7 +83,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -144,7 +148,7 @@
cleanup();
- /*NOTREACHED*/ return (0);
+ return (0);
}
/*
diff --git a/testcases/kernel/syscalls/ipc/semop/semop02.c b/testcases/kernel/syscalls/ipc/semop/semop02.c
index 7ac2903..329e249 100644
--- a/testcases/kernel/syscalls/ipc/semop/semop02.c
+++ b/testcases/kernel/syscalls/ipc/semop/semop02.c
@@ -109,7 +109,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -148,7 +152,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -160,7 +164,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (seteuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/ipc/semop/semop03.c b/testcases/kernel/syscalls/ipc/semop/semop03.c
index 47412ae..e3b1044 100644
--- a/testcases/kernel/syscalls/ipc/semop/semop03.c
+++ b/testcases/kernel/syscalls/ipc/semop/semop03.c
@@ -72,7 +72,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -123,7 +127,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/semop/semop04.c b/testcases/kernel/syscalls/ipc/semop/semop04.c
index 599bbd0..b2ae8da 100644
--- a/testcases/kernel/syscalls/ipc/semop/semop04.c
+++ b/testcases/kernel/syscalls/ipc/semop/semop04.c
@@ -87,7 +87,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -140,7 +144,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/semop/semop05.c b/testcases/kernel/syscalls/ipc/semop/semop05.c
index 703c6cd..b2a47a6 100644
--- a/testcases/kernel/syscalls/ipc/semop/semop05.c
+++ b/testcases/kernel/syscalls/ipc/semop/semop05.c
@@ -117,7 +117,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child_uclinux, "dd", &i_uclinux, &sem_id_1);
@@ -218,7 +222,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/shmat/shmat01.c b/testcases/kernel/syscalls/ipc/shmat/shmat01.c
index f3f3c70..0c0e8b6 100644
--- a/testcases/kernel/syscalls/ipc/shmat/shmat01.c
+++ b/testcases/kernel/syscalls/ipc/shmat/shmat01.c
@@ -92,7 +92,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -139,7 +143,7 @@
cleanup();
- /* NOTREACHED */
+
return 0;
}
diff --git a/testcases/kernel/syscalls/ipc/shmat/shmat02.c b/testcases/kernel/syscalls/ipc/shmat/shmat02.c
index c753cca..f9aaf8a 100644
--- a/testcases/kernel/syscalls/ipc/shmat/shmat02.c
+++ b/testcases/kernel/syscalls/ipc/shmat/shmat02.c
@@ -111,7 +111,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -157,7 +161,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -169,7 +173,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/ipc/shmat/shmat03.c b/testcases/kernel/syscalls/ipc/shmat/shmat03.c
index a02313e..d2af29c 100644
--- a/testcases/kernel/syscalls/ipc/shmat/shmat03.c
+++ b/testcases/kernel/syscalls/ipc/shmat/shmat03.c
@@ -80,7 +80,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
diff --git a/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c b/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c
index 6ee11cf..cd21b3c 100644
--- a/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c
+++ b/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c
@@ -142,7 +142,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
argv0 = av[0];
@@ -214,7 +218,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/shmctl/shmctl02.c b/testcases/kernel/syscalls/ipc/shmctl/shmctl02.c
index 90a39f2..d68e299 100644
--- a/testcases/kernel/syscalls/ipc/shmctl/shmctl02.c
+++ b/testcases/kernel/syscalls/ipc/shmctl/shmctl02.c
@@ -111,7 +111,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -157,7 +161,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -169,7 +173,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/ipc/shmctl/shmctl03.c b/testcases/kernel/syscalls/ipc/shmctl/shmctl03.c
index af69d48..3cd3e60 100644
--- a/testcases/kernel/syscalls/ipc/shmctl/shmctl03.c
+++ b/testcases/kernel/syscalls/ipc/shmctl/shmctl03.c
@@ -100,7 +100,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
diff --git a/testcases/kernel/syscalls/ipc/shmctl/shmctl04.c b/testcases/kernel/syscalls/ipc/shmctl/shmctl04.c
index 870d0ed..e96c76a 100644
--- a/testcases/kernel/syscalls/ipc/shmctl/shmctl04.c
+++ b/testcases/kernel/syscalls/ipc/shmctl/shmctl04.c
@@ -62,7 +62,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -88,7 +92,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/shmdt/shmdt01.c b/testcases/kernel/syscalls/ipc/shmdt/shmdt01.c
index 186e238..aa7082e 100644
--- a/testcases/kernel/syscalls/ipc/shmdt/shmdt01.c
+++ b/testcases/kernel/syscalls/ipc/shmdt/shmdt01.c
@@ -84,7 +84,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -125,7 +129,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/shmdt/shmdt02.c b/testcases/kernel/syscalls/ipc/shmdt/shmdt02.c
index 08ca4ce..5210ec6 100644
--- a/testcases/kernel/syscalls/ipc/shmdt/shmdt02.c
+++ b/testcases/kernel/syscalls/ipc/shmdt/shmdt02.c
@@ -65,7 +65,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -103,7 +107,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/shmget/shmget01.c b/testcases/kernel/syscalls/ipc/shmget/shmget01.c
index 0bf79d4..823f3f2 100644
--- a/testcases/kernel/syscalls/ipc/shmget/shmget01.c
+++ b/testcases/kernel/syscalls/ipc/shmget/shmget01.c
@@ -72,7 +72,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -142,7 +146,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/shmget/shmget02.c b/testcases/kernel/syscalls/ipc/shmget/shmget02.c
index e69dc98..b476359 100644
--- a/testcases/kernel/syscalls/ipc/shmget/shmget02.c
+++ b/testcases/kernel/syscalls/ipc/shmget/shmget02.c
@@ -99,7 +99,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -139,7 +143,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/shmget/shmget03.c b/testcases/kernel/syscalls/ipc/shmget/shmget03.c
index 3133e16..e3ef703 100644
--- a/testcases/kernel/syscalls/ipc/shmget/shmget03.c
+++ b/testcases/kernel/syscalls/ipc/shmget/shmget03.c
@@ -76,7 +76,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -116,7 +120,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/ipc/shmget/shmget04.c b/testcases/kernel/syscalls/ipc/shmget/shmget04.c
index 446c997..54ba0af 100644
--- a/testcases/kernel/syscalls/ipc/shmget/shmget04.c
+++ b/testcases/kernel/syscalls/ipc/shmget/shmget04.c
@@ -70,7 +70,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -109,7 +113,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -128,7 +132,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/ipc/shmget/shmget05.c b/testcases/kernel/syscalls/ipc/shmget/shmget05.c
index 7a29b9d..70beb0a 100644
--- a/testcases/kernel/syscalls/ipc/shmget/shmget05.c
+++ b/testcases/kernel/syscalls/ipc/shmget/shmget05.c
@@ -79,7 +79,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -99,7 +103,7 @@
cleanup();
- /*NOTREACHED*/} else { /* parent */
+ } else { /* parent */
/* wait for the child to return */
if (waitpid(pid, NULL, 0) == -1) {
tst_brkm(TBROK, cleanup, "waitpid failed");
diff --git a/testcases/kernel/syscalls/keyctl/keyctl01.c b/testcases/kernel/syscalls/keyctl/keyctl01.c
index 75cb9c2..f4d612e 100644
--- a/testcases/kernel/syscalls/keyctl/keyctl01.c
+++ b/testcases/kernel/syscalls/keyctl/keyctl01.c
@@ -125,7 +125,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
tst_exit();
}
@@ -178,7 +182,7 @@
}
cleanup();
- /* NOTREACHED */
+
return (1);
}
#else
diff --git a/testcases/kernel/syscalls/kill/kill01.c b/testcases/kernel/syscalls/kill/kill01.c
index c1a93bd..017faeb 100644
--- a/testcases/kernel/syscalls/kill/kill01.c
+++ b/testcases/kernel/syscalls/kill/kill01.c
@@ -82,7 +82,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child, "");
@@ -117,7 +121,7 @@
if (TEST_RETURN == -1) {
tst_brkm(TFAIL, cleanup, "%s failed - errno = %d : %s",
TCID, TEST_ERRNO, strerror(TEST_ERRNO));
- /*NOTREACHED*/}
+ }
if (STD_FUNCTIONAL_TEST) {
/*
@@ -139,7 +143,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
@@ -150,7 +154,7 @@
int exno = 1;
pause();
- /*NOTREACHED*/ exit(exno);
+ exit(exno);
}
/*
diff --git a/testcases/kernel/syscalls/kill/kill03.c b/testcases/kernel/syscalls/kill/kill03.c
index 837d38f..ff4ef09 100644
--- a/testcases/kernel/syscalls/kill/kill03.c
+++ b/testcases/kernel/syscalls/kill/kill03.c
@@ -84,7 +84,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child, "");
@@ -124,7 +128,7 @@
"Expected a return value of -1 got %ld",
TCID, TEST_ERRNO, strerror(TEST_ERRNO),
TEST_RETURN);
- /*NOTREACHED*/}
+ }
if (STD_FUNCTIONAL_TEST) {
/*
@@ -146,7 +150,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
@@ -157,7 +161,7 @@
int exno = 1;
pause();
- /*NOTREACHED*/ exit(exno);
+ exit(exno);
}
/*
diff --git a/testcases/kernel/syscalls/kill/kill04.c b/testcases/kernel/syscalls/kill/kill04.c
index 40d8795..f631b94 100644
--- a/testcases/kernel/syscalls/kill/kill04.c
+++ b/testcases/kernel/syscalls/kill/kill04.c
@@ -84,7 +84,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child, "");
@@ -140,7 +144,7 @@
"Expected a return value of -1 got %ld",
TCID, TEST_ERRNO, strerror(TEST_ERRNO),
TEST_RETURN);
- /*NOTREACHED*/}
+ }
if (STD_FUNCTIONAL_TEST) {
/*
@@ -162,7 +166,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
@@ -173,7 +177,7 @@
int exno = 1;
pause();
- /*NOTREACHED*/ exit(exno);
+ exit(exno);
}
/*
diff --git a/testcases/kernel/syscalls/kill/kill05.c b/testcases/kernel/syscalls/kill/kill05.c
index 43e84ce..9586ebe 100644
--- a/testcases/kernel/syscalls/kill/kill05.c
+++ b/testcases/kernel/syscalls/kill/kill05.c
@@ -107,7 +107,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child, "");
@@ -127,7 +131,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/kill/kill06.c b/testcases/kernel/syscalls/kill/kill06.c
index 2217479..cf3aa1f 100644
--- a/testcases/kernel/syscalls/kill/kill06.c
+++ b/testcases/kernel/syscalls/kill/kill06.c
@@ -83,7 +83,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child, "");
@@ -126,7 +130,7 @@
/* Kill all processes in this process group */
TEST(kill(-getpgrp(), TEST_SIG));
sleep(300);
- /*NOTREACHED*/
+
tst_resm(TINFO, "%d never recieved a"
" signal", getpid());
exit(exno);
@@ -159,7 +163,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
@@ -170,7 +174,7 @@
int exno = 1;
sleep(299);
- /*NOTREACHED*/
+
tst_resm(TINFO, "%d never recieved a" " signal", getpid());
exit(exno);
}
diff --git a/testcases/kernel/syscalls/kill/kill07.c b/testcases/kernel/syscalls/kill/kill07.c
index 5af5c60..9eeea4e 100644
--- a/testcases/kernel/syscalls/kill/kill07.c
+++ b/testcases/kernel/syscalls/kill/kill07.c
@@ -95,7 +95,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child, "");
@@ -153,7 +157,7 @@
if (TEST_RETURN == -1) {
tst_brkm(TFAIL, cleanup, "%s failed - errno = %d : %s",
TCID, TEST_ERRNO, strerror(TEST_ERRNO));
- /*NOTREACHED*/}
+ }
if (STD_FUNCTIONAL_TEST) {
/*
@@ -180,11 +184,11 @@
}
if (shmdt(flag)) {
tst_brkm(TBROK, cleanup, "shmdt failed ");
- /*NOTREACHED*/}
+ }
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
@@ -206,7 +210,7 @@
int exno = 1;
sleep(300);
- /*NOTREACHED*/ tst_resm(TINFO, "Child never recieved a signal");
+ tst_resm(TINFO, "Child never recieved a signal");
exit(exno);
}
diff --git a/testcases/kernel/syscalls/kill/kill08.c b/testcases/kernel/syscalls/kill/kill08.c
index affec88..67c4858 100644
--- a/testcases/kernel/syscalls/kill/kill08.c
+++ b/testcases/kernel/syscalls/kill/kill08.c
@@ -83,7 +83,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child, "");
@@ -126,7 +130,7 @@
/* Kill all processes in this process group */
TEST(kill(0, TEST_SIG));
pause();
- /*NOTREACHED*/ exit(exno);
+ exit(exno);
} else {
waitpid(pid1, &status, 0);
if (TEST_RETURN != 0) {
@@ -156,7 +160,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
@@ -167,7 +171,7 @@
int exno = 1;
pause();
- /*NOTREACHED*/ exit(exno);
+ exit(exno);
}
/*
diff --git a/testcases/kernel/syscalls/kill/kill10.c b/testcases/kernel/syscalls/kill/kill10.c
index fb70c12..303857a 100644
--- a/testcases/kernel/syscalls/kill/kill10.c
+++ b/testcases/kernel/syscalls/kill/kill10.c
@@ -226,25 +226,25 @@
Tst_nobuf = 1;
if ((msg = parse_opts(ac, av, options, &help))) {
- tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg);
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
}
if (nflag) {
if (sscanf(narg, "%i", &num_procs) != 1) {
- tst_brkm(TBROK, tst_exit,
+ tst_brkm(TBROK, NULL,
"-n option arg is not a number");
}
}
if (gflag) {
if (sscanf(garg, "%i", &num_pgrps) != 1) {
- tst_brkm(TBROK, tst_exit,
+ tst_brkm(TBROK, NULL,
"-g option arg is not a number");
}
}
if (dflag) {
if (sscanf(darg, "%i", &debug_flag) != 1) {
- tst_brkm(TBROK, tst_exit,
+ tst_brkm(TBROK, NULL,
"-d option arg is not a number");
}
}
diff --git a/testcases/kernel/syscalls/kill/kill11.c b/testcases/kernel/syscalls/kill/kill11.c
index edc3bf7..20ed012 100644
--- a/testcases/kernel/syscalls/kill/kill11.c
+++ b/testcases/kernel/syscalls/kill/kill11.c
@@ -101,18 +101,20 @@
#ifdef UCLINUX
/* parse standard options */
+<<<<<<< HEAD
if ((msg =
parse_opts(argc, argv, NULL, NULL)) != NULL) {
+=======
+ if ((msg = parse_opts(argc, argv, NULL, NULL)) != NULL)
+>>>>>>> master
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
maybe_run_child(&do_child, "dd", &temp, &sig);
#endif
setup();
// tempdir(); /* move to new directory */
-/*--------------------------------------------------------------------*/
- blenter(); /*<<<<<ENTER DATA HERE<<<<<<<< */
+ blenter();
exno = 1;
unlink("core");
diff --git a/testcases/kernel/syscalls/kill/kill12.c b/testcases/kernel/syscalls/kill/kill12.c
index 25633db..c28578a 100644
--- a/testcases/kernel/syscalls/kill/kill12.c
+++ b/testcases/kernel/syscalls/kill/kill12.c
@@ -101,8 +101,7 @@
setup();
//tempdir(); /* move to new directory */ 12/20/2003
-/*--------------------------------------------------------------------*/
- blenter(); /*<<<<<ENTER DATA HERE<<<<<<<< */
+ blenter();
exno = 1;
diff --git a/testcases/kernel/syscalls/lchown/lchown01.c b/testcases/kernel/syscalls/lchown/lchown01.c
index 01b65f8..d78d450 100644
--- a/testcases/kernel/syscalls/lchown/lchown01.c
+++ b/testcases/kernel/syscalls/lchown/lchown01.c
@@ -80,7 +80,7 @@
#include "test.h"
#include "usctest.h"
-#define FILE_MODE S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
+#define FILE_MODE (S_IFREG|S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)
#define TESTFILE "testfile"
#define SFILE "slink_file"
@@ -110,12 +110,19 @@
int main(int argc, char *argv[])
{
struct stat stat_buf;
- int lc, i;
+ int lc;
char *msg;
+ int i;
+<<<<<<< HEAD
if ((msg = parse_opts(argc, argv, NULL, NULL)) != NULL) {
- tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg);
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
}
+=======
+ if ((msg = parse_opts(argc, argv, NULL, NULL)) != NULL)
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+
+>>>>>>> master
setup();
for (lc = 0; TEST_LOOPING(lc); lc++) {
@@ -128,7 +135,7 @@
char *test_desc = test_cases[i].desc;
/*
- * Call lchwon(2) with different user id and
+ * Call lchown(2) with different user id and
* group id (numeric values) to set it on
* symlink of testfile.
*/
@@ -154,26 +161,28 @@
"%s failed, errno %d",
SFILE, TEST_ERRNO);
}
-
- if (user_id == (uid_t)-1) {
+ if (user_id == -1) {
if (i > 0)
user_id = test_cases[i-1].user_id;
else
user_id = geteuid();
}
-
- if (group_id == (gid_t)-1) {
+ if (group_id == -1) {
if (i > 0)
- group_id = test_cases[i - 1].group_id;
+ group_id = test_cases[i-1].group_id;
else
group_id = getegid();
}
+ /*
+ * Check for expected Ownership ids
+ * set on testfile.
+ */
if ((stat_buf.st_uid != user_id) ||
(stat_buf.st_gid != group_id)) {
tst_resm(TFAIL,
"%s: incorrect ownership set, "
- "expected %u %u", SFILE,
+ "Expected %d %d", SFILE,
user_id, group_id);
} else {
tst_resm(TPASS, "lchown() succeeds to "
@@ -186,6 +195,7 @@
}
cleanup();
+
tst_exit();
}
@@ -202,21 +212,24 @@
/* capture signals */
tst_sig(NOFORK, DEF_HANDLER, cleanup);
- tst_require_root(tst_exit);
+ tst_require_root(NULL);
TEST_PAUSE;
tst_tmpdir();
if ((fd = open(TESTFILE, O_RDWR | O_CREAT, FILE_MODE)) == -1) {
- tst_brkm(TBROK | TERRNO, cleanup, "open(2) %s mode %o failed",
- TESTFILE, FILE_MODE);
+ tst_brkm(TBROK, cleanup, "open(%s, O_RDWR|O_CREAT, %o) failed",
+ TESTFILE, FILE_MODE);
+ }
+ if (close(fd) == -1) {
+ tst_brkm(TBROK|TERRNO, cleanup, "close(%s) failed", TESTFILE);
}
if (close(fd) == -1)
- tst_brkm(TBROK | TERRNO, cleanup, "close(2) %s", TESTFILE);
+ tst_brkm(TBROK|TERRNO, cleanup, "close(2) %s", TESTFILE);
if (symlink(TESTFILE, SFILE) < 0) {
- tst_brkm(TBROK | TERRNO, cleanup, "symlink(2) %s to %s failed",
+ tst_brkm(TBROK|TERRNO, cleanup, "symlink(2) %s to %s failed",
TESTFILE, SFILE);
}
}
diff --git a/testcases/kernel/syscalls/lchown/lchown02.c b/testcases/kernel/syscalls/lchown/lchown02.c
index 6dd5b2d..4b98781 100644
--- a/testcases/kernel/syscalls/lchown/lchown02.c
+++ b/testcases/kernel/syscalls/lchown/lchown02.c
@@ -152,9 +152,15 @@
gid_t group_id;
int i;
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
}
+=======
+ /* Parse standard options given to run the test. */
+ if ((msg = parse_opts(argc, argv, NULL, NULL)) != NULL)
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
setup();
/* set the expected errnos... */
diff --git a/testcases/kernel/syscalls/linkat/linkat01.c b/testcases/kernel/syscalls/linkat/linkat01.c
index d7ade4a..038408d 100644
--- a/testcases/kernel/syscalls/linkat/linkat01.c
+++ b/testcases/kernel/syscalls/linkat/linkat01.c
@@ -211,7 +211,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/listen/listen01.c b/testcases/kernel/syscalls/listen/listen01.c
index 9d33ee9..c94dd1f 100644
--- a/testcases/kernel/syscalls/listen/listen01.c
+++ b/testcases/kernel/syscalls/listen/listen01.c
@@ -92,7 +92,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -128,7 +132,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
void setup(void)
diff --git a/testcases/kernel/syscalls/llseek/llseek01.c b/testcases/kernel/syscalls/llseek/llseek01.c
index 64afba0..7638508 100644
--- a/testcases/kernel/syscalls/llseek/llseek01.c
+++ b/testcases/kernel/syscalls/llseek/llseek01.c
@@ -106,7 +106,11 @@
loff_t offset; /* Ret value from llseek */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -191,7 +195,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/llseek/llseek02.c b/testcases/kernel/syscalls/llseek/llseek02.c
index b0e3dcc..698e8a9 100644
--- a/testcases/kernel/syscalls/llseek/llseek02.c
+++ b/testcases/kernel/syscalls/llseek/llseek02.c
@@ -129,7 +129,11 @@
int ind; /* counter to test different test conditions */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -187,7 +191,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/lseek/lseek06.c b/testcases/kernel/syscalls/lseek/lseek06.c
index 4daa3f8..2ae7e92 100644
--- a/testcases/kernel/syscalls/lseek/lseek06.c
+++ b/testcases/kernel/syscalls/lseek/lseek06.c
@@ -98,7 +98,11 @@
char read_buf[1]; /* data read from temp. file */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -168,7 +172,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/lseek/lseek07.c b/testcases/kernel/syscalls/lseek/lseek07.c
index 6ec57d7..013dcdc 100644
--- a/testcases/kernel/syscalls/lseek/lseek07.c
+++ b/testcases/kernel/syscalls/lseek/lseek07.c
@@ -102,7 +102,11 @@
off_t offset; /* byte position in temporary file */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -209,7 +213,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/lseek/lseek08.c b/testcases/kernel/syscalls/lseek/lseek08.c
index 521bc9d..fc74ce3 100644
--- a/testcases/kernel/syscalls/lseek/lseek08.c
+++ b/testcases/kernel/syscalls/lseek/lseek08.c
@@ -98,7 +98,11 @@
char read_buf[1]; /* data read from temp. file */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -160,7 +164,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /* NOTREACHED */
+
return 0;
} /* End main */
diff --git a/testcases/kernel/syscalls/lseek/lseek09.c b/testcases/kernel/syscalls/lseek/lseek09.c
index 4aa0ddb..1023a00 100644
--- a/testcases/kernel/syscalls/lseek/lseek09.c
+++ b/testcases/kernel/syscalls/lseek/lseek09.c
@@ -100,7 +100,11 @@
char read_buf[BUFSIZ]; /* data read from temp. file */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -180,7 +184,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/lseek/lseek10.c b/testcases/kernel/syscalls/lseek/lseek10.c
index f6ab209..582e4dd 100644
--- a/testcases/kernel/syscalls/lseek/lseek10.c
+++ b/testcases/kernel/syscalls/lseek/lseek10.c
@@ -132,7 +132,11 @@
int ind; /* counter to test different test conditions */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -191,7 +195,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/lstat/lstat01.c b/testcases/kernel/syscalls/lstat/lstat01.c
index 34714b8..ce5f0c8 100644
--- a/testcases/kernel/syscalls/lstat/lstat01.c
+++ b/testcases/kernel/syscalls/lstat/lstat01.c
@@ -140,7 +140,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/lstat/lstat02.c b/testcases/kernel/syscalls/lstat/lstat02.c
index 29ebb6a..8c26102 100644
--- a/testcases/kernel/syscalls/lstat/lstat02.c
+++ b/testcases/kernel/syscalls/lstat/lstat02.c
@@ -152,7 +152,11 @@
int ind; /* counter to test different test conditions */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -214,7 +218,7 @@
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
/*
@@ -233,7 +237,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/lstat/lstat03.c b/testcases/kernel/syscalls/lstat/lstat03.c
index de5d547..46bbb88 100644
--- a/testcases/kernel/syscalls/lstat/lstat03.c
+++ b/testcases/kernel/syscalls/lstat/lstat03.c
@@ -87,8 +87,8 @@
char *TCID = "lstat03"; /* Test program identifier. */
int TST_TOTAL = 1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
-uid_t User_id; /* user id/group id of test process */
-gid_t Group_id;
+uid_t user_id; /* user id/group id of test process */
+gid_t group_id;
char nobody_uid[] = "nobody";
struct passwd *ltpuser;
@@ -103,7 +103,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -139,8 +143,8 @@
* Verify the data returned by lstat(2)
* aganist the expected data.
*/
- if ((stat_buf.st_uid != User_id) ||
- (stat_buf.st_gid != Group_id) ||
+ if ((stat_buf.st_uid != user_id) ||
+ (stat_buf.st_gid != group_id) ||
(!(stat_buf.st_mode && S_IFLNK)) ||
(stat_buf.st_size != strlen(TESTFILE))) {
tst_resm(TFAIL, "Functionality of lstat(2) on "
@@ -157,7 +161,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
/*
@@ -180,7 +184,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
@@ -229,8 +233,8 @@
}
/* Get the uid/gid of the process */
- User_id = getuid();
- Group_id = getgid();
+ user_id = getuid();
+ group_id = getgid();
}
/*
diff --git a/testcases/kernel/syscalls/mbind/mbind01.c b/testcases/kernel/syscalls/mbind/mbind01.c
index 25adf60..b0c2304 100644
--- a/testcases/kernel/syscalls/mbind/mbind01.c
+++ b/testcases/kernel/syscalls/mbind/mbind01.c
@@ -361,7 +361,11 @@
/* parse standard options */
if ((msg = parse_opts(argc, argv, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
tst_exit();
}
diff --git a/testcases/kernel/syscalls/memmap/mem03.c b/testcases/kernel/syscalls/memmap/mem03.c
index 9d135a6..10c28c9 100644
--- a/testcases/kernel/syscalls/memmap/mem03.c
+++ b/testcases/kernel/syscalls/memmap/mem03.c
@@ -141,7 +141,7 @@
/* clean up and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/mkdir/mkdir01.c b/testcases/kernel/syscalls/mkdir/mkdir01.c
index 5e0c1ed..72dffd2 100644
--- a/testcases/kernel/syscalls/mkdir/mkdir01.c
+++ b/testcases/kernel/syscalls/mkdir/mkdir01.c
@@ -116,10 +116,6 @@
void setup();
void cleanup();
-#if !defined(UCLINUX)
-char *get_high_address();
-#endif
-
char *TCID = "mkdir01"; /* Test program identifier. */
int TST_TOTAL = 2; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
@@ -133,23 +129,20 @@
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
+<<<<<<< HEAD
/***************************************************************
* parse standard options
***************************************************************/
+=======
+>>>>>>> master
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /***************************************************************
- * perform global setup for test
- ***************************************************************/
setup();
/* set the expected errnos... */
TEST_EXP_ENOS(exp_enos);
- /***************************************************************
- * check looping state if -c option given
- ***************************************************************/
for (lc = 0; TEST_LOOPING(lc); lc++) {
/* reset Tst_count in case we are looping. */
@@ -168,9 +161,6 @@
TEST_ERROR_LOG(TEST_ERRNO);
}
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
if (STD_FUNCTIONAL_TEST) {
if (TEST_RETURN == -1) {
if (TEST_ERRNO == EFAULT) {
@@ -204,9 +194,6 @@
TEST_ERROR_LOG(TEST_ERRNO);
}
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
if (STD_FUNCTIONAL_TEST) {
if (TEST_RETURN == -1) {
if (TEST_ERRNO == EFAULT) {
@@ -230,13 +217,9 @@
} /* End for TEST_LOOPING */
- /***************************************************************
- * cleanup and exit
- ***************************************************************/
cleanup();
-
- return 0;
-} /* End main */
+ tst_exit();
+}
/***************************************************************
* setup() - performs all ONE TIME setup for this test.
diff --git a/testcases/kernel/syscalls/mkdir/mkdir02.c b/testcases/kernel/syscalls/mkdir/mkdir02.c
index c25633e..515c7fa 100644
--- a/testcases/kernel/syscalls/mkdir/mkdir02.c
+++ b/testcases/kernel/syscalls/mkdir/mkdir02.c
@@ -107,7 +107,11 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/*
@@ -135,7 +139,7 @@
if ((pid = FORK_OR_VFORK()) < 0) {
tst_brkm(TFAIL, cleanup, "fork() failed");
- /* NOTREACHED */
+
}
if (pid == 0) { /* first child */
@@ -147,7 +151,7 @@
"effective gid to %d",
ltpuser1->pw_gid, ltpuser1->pw_gid);
exit(1);
- /* NOTREACHED */
+
}
/* being ltupuser1 */
rval = setreuid(ltpuser1->pw_uid, ltpuser1->pw_uid);
@@ -158,7 +162,7 @@
"effective uid to %d",
ltpuser1->pw_uid, ltpuser1->pw_uid);
exit(1);
- /* NOTREACHED */
+
}
/*
@@ -171,7 +175,7 @@
" a directory with Set "
" group ID turn on ");
exit(1);
- /* NOTREACHED */
+
}
if (stat(tstdir1, &buf1) == -1) {
perror("stat");
@@ -179,18 +183,18 @@
"failed to stat the new directory"
"in mkdir()");
exit(1);
- /* NOTREACHED */
+
}
if (chmod(tstdir1, buf1.st_mode | S_ISGID) != 0) {
perror("chmod");
tst_resm(TFAIL, "failed to set S_ISGID bit");
exit(1);
- /* NOTREACHED */
+
}
/* Successfully create the parent directory */
exit(0);
- /* NOTREACHED */
+
}
wait(&status);
if (WEXITSTATUS(status) != 0) {
@@ -211,7 +215,7 @@
if ((pid1 = FORK_OR_VFORK()) < 0) {
perror("fork failed");
tst_brkm(TFAIL, cleanup, "fork() failed");
- /* NOTREACHED */
+
} else if (pid1 == 0) { /* second child */
/* being user ltpuser2 */
@@ -223,7 +227,7 @@
ltpuser2->pw_gid, ltpuser2->pw_gid);
perror("setregid");
exit(1);
- /* NOTREACHED */
+
}
rval = setreuid(ltpuser2->pw_uid, ltpuser2->pw_uid);
if (rval < 0) {
@@ -233,7 +237,7 @@
ltpuser2->pw_uid, ltpuser2->pw_uid);
perror("setreuid");
exit(1);
- /* NOTREACHED */
+
}
@@ -247,7 +251,7 @@
" a directory %s under %s ", tstdir2,
tstdir1);
exit(1);
- /* NOTREACHED */
+
}
/*
* check the group ID
@@ -259,14 +263,14 @@
"failed to stat the new directory"
"in mkdir()");
exit(1);
- /* NOTREACHED */
+
}
if (stat(tstdir1, &buf1) == -1) {
tst_resm(TFAIL,
"failed to stat the new directory"
"in mkdir()");
exit(1);
- /* NOTREACHED */
+
}
if (buf.st_gid != buf1.st_gid) {
tst_resm(TFAIL, "mkdir() FAILED to inherit "
@@ -274,7 +278,7 @@
" directory %d",
buf.st_gid, buf1.st_gid);
exit(1);
- /* NOTREACHED */
+
}
/* check the S_ISGID bit */
@@ -283,11 +287,11 @@
" the S_ISGID bit from parent "
" directory");
exit(1);
- /* NOTREACHED */
+
}
/* PASS */
exit(0);
- /* NOTREACHED */
+
}
waitpid(pid1, &status, 0);
@@ -298,7 +302,7 @@
tst_resm(TFAIL, "Test to attempt to make a directory"
" inherits group ID FAILED");
cleanup();
- /*NOTREACHED*/}
+ }
} /* End for TEST_LOOPING */
@@ -307,7 +311,7 @@
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/mkdir/mkdir03.c b/testcases/kernel/syscalls/mkdir/mkdir03.c
index 011bce3..5052367 100644
--- a/testcases/kernel/syscalls/mkdir/mkdir03.c
+++ b/testcases/kernel/syscalls/mkdir/mkdir03.c
@@ -139,7 +139,11 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/*
@@ -192,7 +196,7 @@
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
@@ -252,7 +256,7 @@
/* create a file */
if ((fileHandle2 = creat(tstfile5, PERMS)) == -1) {
tst_brkm(TBROK, cleanup, "creat a file failed");
- /*NOTREACHED*/}
+ }
}
/*
diff --git a/testcases/kernel/syscalls/mkdir/mkdir04.c b/testcases/kernel/syscalls/mkdir/mkdir04.c
index a7ed717..238d6cb 100644
--- a/testcases/kernel/syscalls/mkdir/mkdir04.c
+++ b/testcases/kernel/syscalls/mkdir/mkdir04.c
@@ -111,7 +111,11 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/*
@@ -136,7 +140,7 @@
if ((pid = FORK_OR_VFORK()) < 0) {
tst_brkm(TBROK, cleanup, "fork #1 failed");
- /*NOTREACHED*/}
+ }
if (pid == 0) { /* first child */
/* set to ltpuser1 */
@@ -148,13 +152,13 @@
ltpuser1->pw_uid, ltpuser1->pw_uid);
perror("setreuid");
exit(1);
- /*NOTREACHED*/}
+ }
/* create the parent directory with 0700 permits */
if (mkdir(tstdir1, PERMS) == -1) {
tst_resm(TFAIL, "mkdir(%s, %#o) Failed",
tstdir1, PERMS);
exit(1);
- /*NOTREACHED*/}
+ }
/* create tstdir1 succeeded */
exit(0);
}
@@ -170,7 +174,7 @@
if ((pid1 = FORK_OR_VFORK()) < 0) {
tst_brkm(TBROK, cleanup, "fork #2 failed");
- /*NOTREACHED*/}
+ }
if (pid1 == 0) { /* second child */
/* set to ltpuser2 */
@@ -182,17 +186,17 @@
ltpuser2->pw_uid, ltpuser2->pw_uid);
perror("setreuid");
exit(1);
- /*NOTREACHED*/}
+ }
if (mkdir(tstdir2, PERMS) != -1) {
tst_resm(TFAIL, "mkdir(%s, %#o) unexpected "
"succeeded", tstdir2, PERMS);
exit(1);
- /*NOTREACHED*/}
+ }
if (errno != EACCES) {
tst_resm(TFAIL, "Expected EACCES got %d",
errno);
exit(1);
- /*NOTREACHED*/}
+ }
/* PASS */
exit(0);
}
@@ -213,7 +217,7 @@
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
/*
@@ -223,8 +227,8 @@
{
/* must run as root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Must run this as root");
- /*NOTREACHED*/}
+ tst_brkm(TBROK, NULL, "Must run this as root");
+ }
/* capture signals */
tst_sig(FORK, DEF_HANDLER, cleanup);
diff --git a/testcases/kernel/syscalls/mkdir/mkdir05.c b/testcases/kernel/syscalls/mkdir/mkdir05.c
index f6ad562..66f28ac 100644
--- a/testcases/kernel/syscalls/mkdir/mkdir05.c
+++ b/testcases/kernel/syscalls/mkdir/mkdir05.c
@@ -98,7 +98,11 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/*
@@ -134,7 +138,7 @@
if (stat(tstdir1, &buf) == -1) {
tst_brkm(TBROK, cleanup, "failed to stat the "
"new directory");
- /*NOTREACHED*/}
+ }
/* check the owner */
if (buf.st_uid != geteuid()) {
tst_resm(TFAIL, "mkdir() FAILED to set owner ID"
@@ -163,7 +167,7 @@
* cleanup and exit
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
/*
@@ -173,7 +177,7 @@
{
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/mkdir/mkdir08.c b/testcases/kernel/syscalls/mkdir/mkdir08.c
index d22f69d..55d0e8a 100644
--- a/testcases/kernel/syscalls/mkdir/mkdir08.c
+++ b/testcases/kernel/syscalls/mkdir/mkdir08.c
@@ -139,7 +139,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/mkdirat/mkdirat01.c b/testcases/kernel/syscalls/mkdirat/mkdirat01.c
index 109958d..4fde6fc 100644
--- a/testcases/kernel/syscalls/mkdirat/mkdirat01.c
+++ b/testcases/kernel/syscalls/mkdirat/mkdirat01.c
@@ -91,7 +91,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/mknod/mknod02.c b/testcases/kernel/syscalls/mknod/mknod02.c
index 23a7e58..b2b010f 100644
--- a/testcases/kernel/syscalls/mknod/mknod02.c
+++ b/testcases/kernel/syscalls/mknod/mknod02.c
@@ -110,7 +110,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -198,7 +202,7 @@
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/mknod/mknod03.c b/testcases/kernel/syscalls/mknod/mknod03.c
index 54c1ff1..b8013d8 100644
--- a/testcases/kernel/syscalls/mknod/mknod03.c
+++ b/testcases/kernel/syscalls/mknod/mknod03.c
@@ -110,7 +110,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -197,7 +201,7 @@
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/mknod/mknod04.c b/testcases/kernel/syscalls/mknod/mknod04.c
index 75084c0..e0c95a6 100644
--- a/testcases/kernel/syscalls/mknod/mknod04.c
+++ b/testcases/kernel/syscalls/mknod/mknod04.c
@@ -110,7 +110,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -197,7 +201,7 @@
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/mknod/mknod05.c b/testcases/kernel/syscalls/mknod/mknod05.c
index e268a10..5dd4f7b 100644
--- a/testcases/kernel/syscalls/mknod/mknod05.c
+++ b/testcases/kernel/syscalls/mknod/mknod05.c
@@ -110,7 +110,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -196,7 +200,7 @@
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/mknod/mknod06.c b/testcases/kernel/syscalls/mknod/mknod06.c
index 9313292..7b97146 100644
--- a/testcases/kernel/syscalls/mknod/mknod06.c
+++ b/testcases/kernel/syscalls/mknod/mknod06.c
@@ -142,7 +142,11 @@
int ind; /* counter to test different test conditions */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -207,7 +211,7 @@
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/mknod/mknod07.c b/testcases/kernel/syscalls/mknod/mknod07.c
index cf843f2..ffd22a9 100644
--- a/testcases/kernel/syscalls/mknod/mknod07.c
+++ b/testcases/kernel/syscalls/mknod/mknod07.c
@@ -124,7 +124,11 @@
int mode; /* creation mode for the node created */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -184,7 +188,7 @@
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
/*
@@ -206,7 +210,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (seteuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/mknod/mknod08.c b/testcases/kernel/syscalls/mknod/mknod08.c
index 4eae8db..502314b 100644
--- a/testcases/kernel/syscalls/mknod/mknod08.c
+++ b/testcases/kernel/syscalls/mknod/mknod08.c
@@ -109,7 +109,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -195,7 +199,7 @@
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/mknod/mknod09.c b/testcases/kernel/syscalls/mknod/mknod09.c
index 0f6b0f2..5510f46 100644
--- a/testcases/kernel/syscalls/mknod/mknod09.c
+++ b/testcases/kernel/syscalls/mknod/mknod09.c
@@ -89,7 +89,11 @@
char *test_desc; /* test specific error message */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -137,7 +141,7 @@
/* Call cleanup */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/mknodat/mknodat01.c b/testcases/kernel/syscalls/mknodat/mknodat01.c
index 3706faf..c6be3d0 100644
--- a/testcases/kernel/syscalls/mknodat/mknodat01.c
+++ b/testcases/kernel/syscalls/mknodat/mknodat01.c
@@ -99,7 +99,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/mlock/mlock03.c b/testcases/kernel/syscalls/mlock/mlock03.c
index d11e42d..3008713 100644
--- a/testcases/kernel/syscalls/mlock/mlock03.c
+++ b/testcases/kernel/syscalls/mlock/mlock03.c
@@ -58,7 +58,7 @@
msg = parse_opts(argc, argv, NULL, NULL);
if (msg != NULL)
- tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg);
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
setup();
for (lc = 0; TEST_LOOPING(lc); lc++) {
fp = fopen("/proc/self/maps", "r");
diff --git a/testcases/kernel/syscalls/mlockall/mlockall01.c b/testcases/kernel/syscalls/mlockall/mlockall01.c
index 42b87f1..9c21c73 100644
--- a/testcases/kernel/syscalls/mlockall/mlockall01.c
+++ b/testcases/kernel/syscalls/mlockall/mlockall01.c
@@ -160,7 +160,7 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* set the expected errnos... */
diff --git a/testcases/kernel/syscalls/mmap/mmap02.c b/testcases/kernel/syscalls/mmap/mmap02.c
index 5542853..1fa597c 100644
--- a/testcases/kernel/syscalls/mmap/mmap02.c
+++ b/testcases/kernel/syscalls/mmap/mmap02.c
@@ -102,10 +102,8 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
- msg = parse_opts(ac, av, NULL, NULL);
- if (msg != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/* Perform global setup for test */
setup();
diff --git a/testcases/kernel/syscalls/mmap/mmap03.c b/testcases/kernel/syscalls/mmap/mmap03.c
index fc2d8df..1142459 100644
--- a/testcases/kernel/syscalls/mmap/mmap03.c
+++ b/testcases/kernel/syscalls/mmap/mmap03.c
@@ -311,7 +311,4 @@
/* Remove tmp dir and all files in it */
tst_rmdir();
-
- /* exit with return code appropriate for results */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/mmap/mmap05.c b/testcases/kernel/syscalls/mmap/mmap05.c
index 0e1cdf8..b9239dc 100644
--- a/testcases/kernel/syscalls/mmap/mmap05.c
+++ b/testcases/kernel/syscalls/mmap/mmap05.c
@@ -95,7 +95,7 @@
size_t page_sz; /* system page size */
volatile char *addr; /* addr of memory mapped region */
int fildes; /* file descriptor for temporary file */
-volatile int pass = 0; /* pass flag perhaps set to 1 in sig_handler */
+volatile int pass = 0;
sigjmp_buf env; /* environment for sigsetjmp/siglongjmp */
void setup(); /* Main setup function of test */
@@ -108,7 +108,6 @@
char *msg; /* message returned from parse_opts */
char file_content; /* tempfile content */
- /* Parse standard options given to run the test. */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
@@ -166,8 +165,7 @@
/* Unmap mapped memory and reset pass in case we are looping */
if (munmap((void *)addr, page_sz) != 0) {
- tst_brkm(TFAIL, cleanup, "munmap() fails to unmap the "
- "memory, errno=%d", errno);
+ tst_brkm(TFAIL|TERRNO, cleanup, "munmap failed");
}
pass = 0;
@@ -201,7 +199,7 @@
}
/* Allocate space for the test buffer */
- if ((tst_buff = (char *)calloc(page_sz, sizeof(char))) == NULL) {
+ if ((tst_buff = calloc(page_sz, sizeof(char))) == NULL) {
tst_brkm(TFAIL, NULL, "calloc failed (tst_buff)");
}
@@ -247,7 +245,7 @@
}
/*
- * sig_handler() - Signal Cathing function.
+ * sig_handler() - Signal Catching function.
* This function gets executed when the test process receives
* the signal SIGSEGV while trying to access the contents of memory which
* is not accessible.
diff --git a/testcases/kernel/syscalls/mmap/mmap10.c b/testcases/kernel/syscalls/mmap/mmap10.c
index fe9d622..8924f8f 100644
--- a/testcases/kernel/syscalls/mmap/mmap10.c
+++ b/testcases/kernel/syscalls/mmap/mmap10.c
@@ -87,7 +87,7 @@
msg = parse_opts(argc, argv, options, help);
if (msg != NULL)
- tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg);
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
setup();
for (lc = 0; TEST_LOOPING(lc); lc++) {
Tst_count = 0;
diff --git a/testcases/kernel/syscalls/mmap/mmap11.c b/testcases/kernel/syscalls/mmap/mmap11.c
index 0cd32d4..c17b77e 100644
--- a/testcases/kernel/syscalls/mmap/mmap11.c
+++ b/testcases/kernel/syscalls/mmap/mmap11.c
@@ -73,7 +73,7 @@
msg = parse_opts(argc, argv, NULL, NULL);
if (msg != NULL)
- tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg);
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
setup();
check();
cleanup();
diff --git a/testcases/kernel/syscalls/modify_ldt/modify_ldt01.c b/testcases/kernel/syscalls/modify_ldt/modify_ldt01.c
index cbc4d95..741d923 100644
--- a/testcases/kernel/syscalls/modify_ldt/modify_ldt01.c
+++ b/testcases/kernel/syscalls/modify_ldt/modify_ldt01.c
@@ -106,8 +106,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup(); /* global setup */
@@ -184,7 +188,7 @@
*/
if (create_segment(seg, sizeof(seg)) == -1) {
tst_brkm(TINFO, cleanup, "Creation of segment failed");
- /*NOTREACHED*/}
+ }
/*
* Check for EFAULT
diff --git a/testcases/kernel/syscalls/modify_ldt/modify_ldt02.c b/testcases/kernel/syscalls/modify_ldt/modify_ldt02.c
index 48b6d1f..857e5ff 100644
--- a/testcases/kernel/syscalls/modify_ldt/modify_ldt02.c
+++ b/testcases/kernel/syscalls/modify_ldt/modify_ldt02.c
@@ -102,8 +102,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup(); /* global setup */
@@ -120,7 +124,7 @@
seg[0] = 12345;
if (create_segment(seg, sizeof(seg)) == -1) {
tst_brkm(TINFO, cleanup, "Creation of segment failed");
- /*NOTREACHED*/}
+ }
val = read_segment(0);
@@ -144,7 +148,7 @@
if (create_segment(0, 10) == -1) {
tst_brkm(TINFO, cleanup, "Creation of segment failed");
- /*NOTREACHED*/}
+ }
tst_flush();
if ((pid = FORK_OR_VFORK()) == 0) {
diff --git a/testcases/kernel/syscalls/mount/mount01.c b/testcases/kernel/syscalls/mount/mount01.c
index 0536774..275a734 100644
--- a/testcases/kernel/syscalls/mount/mount01.c
+++ b/testcases/kernel/syscalls/mount/mount01.c
@@ -106,31 +106,27 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
- if ((msg = parse_opts(ac, av, options, &help)) != NULL) {
+ if ((msg = parse_opts(ac, av, options, &help)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
/* Check for mandatory option of the testcase */
- if (!Dflag) {
- tst_brkm(TBROK, NULL, "You must specifiy the device used for "
- " mounting with -D option, Run '%s -h' for option "
- " information.", TCID);
- tst_exit();
- }
+ if (!Dflag)
+ tst_brkm(TBROK, NULL,
+ "you must specify the device used for mounting with the -D "
+ "option");
if (Tflag) {
- Fstype = (char *)malloc(strlen(fstype) + 1);
+ Fstype = malloc(strlen(fstype) + 1);
if (Fstype == NULL) {
- tst_brkm(TBROK, NULL, "malloc - failed to alloc %d"
- "errno %d", strlen(fstype), errno);
+ tst_brkm(TBROK|TERRNO, NULL,
+ "malloc - failed to alloc %zd", strlen(fstype));
}
strncpy(Fstype, fstype, strlen(fstype) + 1);
} else {
- Fstype = (char *)malloc(strlen(DEFAULT_FSTYPE) + 1);
+ Fstype = malloc(strlen(DEFAULT_FSTYPE) + 1);
if (Fstype == NULL) {
- tst_brkm(TBROK, NULL, "malloc - failed to alloc %d"
- "errno %d", strlen(DEFAULT_FSTYPE), errno);
+ tst_brkm(TBROK, NULL, "malloc - failed to alloc %d",
+ strlen(DEFAULT_FSTYPE));
}
strncpy(Fstype, DEFAULT_FSTYPE, strlen(DEFAULT_FSTYPE) + 1);
}
@@ -156,17 +152,13 @@
/* check return code */
if (TEST_RETURN != 0) {
- TEST_ERROR_LOG(TEST_ERRNO);
- tst_resm(TFAIL, "mount(2) Failed errno = %d : %s",
- TEST_ERRNO, strerror(TEST_ERRNO));
+ tst_resm(TFAIL|TTERRNO, "mount(2) failed");
} else {
- tst_resm(TPASS, "mount(2) Passed ");
+ tst_resm(TPASS, "mount(2) passed ");
TEST(umount(mntpoint));
if (TEST_RETURN != 0) {
- TEST_ERROR_LOG(TEST_ERRNO);
- tst_brkm(TBROK, cleanup, "umount(2) Failed "
- "while unmounting errno = %d : %s",
- TEST_ERRNO, strerror(TEST_ERRNO));
+ tst_brkm(TBROK|TTERRNO, cleanup,
+ "umount(2) failed");
}
}
} /* End for TEST_LOOPING */
@@ -174,8 +166,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
-
+ tst_exit();
} /* End main */
/* setup() - performs all ONE TIME setup for this test */
@@ -186,8 +177,11 @@
/* Check whether we are root */
if (geteuid() != 0) {
- free(Fstype);
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ if (Fstype != NULL) {
+ free(Fstype);
+ Fstype = NULL;
+ }
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* make a temp directory */
@@ -197,9 +191,8 @@
(void)sprintf(mntpoint, "mnt_%d", getpid());
if (mkdir(mntpoint, DIR_MODE) < 0) {
- tst_brkm(TBROK, cleanup, "mkdir(%s, %#o) failed; "
- "errno = %d: %s", mntpoint, DIR_MODE, errno,
- strerror(errno));
+ tst_brkm(TBROK|TERRNO, cleanup, "mkdir(%s, %#o) failed",
+ mntpoint, DIR_MODE);
}
/* Pause if that option was specified */
@@ -213,8 +206,10 @@
*/
void cleanup()
{
- free(Fstype);
-
+ if (Fstype) {
+ free(Fstype);
+ Fstype = NULL;
+ }
/*
* print timing stats if that option was specified.
* print errno log if that option was specified.
@@ -223,9 +218,6 @@
/* Remove tmp dir and all files in it */
tst_rmdir();
-
- /* exit with return code appropriate for results */
- tst_exit();
} /* End cleanup() */
/*
diff --git a/testcases/kernel/syscalls/mount/mount02.c b/testcases/kernel/syscalls/mount/mount02.c
index 248cb40..1e72ba5 100644
--- a/testcases/kernel/syscalls/mount/mount02.c
+++ b/testcases/kernel/syscalls/mount/mount02.c
@@ -124,34 +124,12 @@
static int Tflag = 0;
static int Dflag = 0;
-static struct test_case_t {
- char *err_desc; /* error description */
- int exp_errno; /* Expected error no */
- char *exp_errval; /* Expected error value string */
-} testcases[] = {
- {
- "Fstype not configured", ENODEV, "ENODEV"}, {
- "Not a block device", ENOTBLK, "ENOTBLK"}, {
- "Already mounted/busy", EBUSY, "EBUSY"}, {
- "Cannot remount as read-only", EBUSY, "EBUSY"}, {
- "Invalid device ", EINVAL, "EINVAL"}, {
- "Invalid fstype ", EINVAL, "EINVAL"}, {
- "Attempted remounted without mounting ", EINVAL, "EINVAL"}, {
- "Invalid address space for fstype", EFAULT, "EFAULT"}, {
- "Invalid address space for Device", EFAULT, "EFAULT"}, {
- "Pathname too long", ENAMETOOLONG, "ENAMETOOLONG"}, {
- "Pathname empty", ENOENT, "ENOENT"}, {
- "Directory not found", ENOENT, "ENOENT"}, {
- "Not a Directory", ENOTDIR, "ENOTDIR"}
-};
-
-/* Total number of test cases. */
-int TST_TOTAL = sizeof(testcases) / sizeof(testcases[0]);
-
static int exp_enos[] = { ENODEV, ENOTBLK, EBUSY, EINVAL, EFAULT, ENAMETOOLONG,
ENOENT, ENOTDIR, 0
};
+int TST_TOTAL = (sizeof(exp_enos) / sizeof(exp_enos[0])) - 1;
+
static option_t options[] = { /* options supported by mount02 test */
{"T:", &Tflag, &fstype}, /* -T type of filesystem */
{"D:", &Dflag, &device}, /* -D device used for mounting */
@@ -163,25 +141,17 @@
int lc, i; /* loop counter */
char *msg; /* message returned from parse_opts */
- /* parse standard options */
- if ((msg = parse_opts(ac, av, options, &help)) != NULL) {
+ if ((msg = parse_opts(ac, av, options, &help)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
/* Check for mandatory option of the testcase */
- if (Dflag == 0) {
+ if (Dflag == 0)
tst_brkm(TBROK, NULL, "You must specifiy the device used for "
- " mounting with -D option, Run '%s -h' for option "
- " information.", TCID);
- tst_exit();
- }
+ " mounting with -D option.");
- Type = (char *)malloc(FSTYPE_LEN);
- if (!Type) {
- tst_brkm(TBROK, NULL, "malloc - alloc of %d failed",
- FSTYPE_LEN);
- tst_exit();
+ Type = malloc(FSTYPE_LEN);
+ if (Type == NULL) {
+ tst_brkm(TBROK|TERRNO, NULL, "malloc failed");
}
if (Tflag == 1) {
@@ -210,10 +180,8 @@
for (i = 0; i < TST_TOTAL; ++i) {
- if (setup_test(i, lc)) {
- tst_resm(TWARN, "Not able to test mount(2) for "
- "error %s as setup failed",
- testcases[i].exp_errval);
+ if (setup_test(i, lc) != 0) {
+ tst_resm(TWARN, "testcase setup failed");
continue;
}
@@ -224,28 +192,20 @@
TEST(mount(Device, Mntpoint, Fstype, Flag, NULL));
/* check return code */
- if ((TEST_RETURN == -1) &&
- (TEST_ERRNO == testcases[i].exp_errno)) {
- tst_resm(TPASS, "mount(2) expected failure; "
- "Got errno - %s : %s",
- testcases[i].exp_errval,
- testcases[i].err_desc);
+ if (TEST_RETURN == -1 && TEST_ERRNO == exp_enos[i]) {
+ tst_resm(TPASS|TERRNO,
+ "mount got expected failure");
} else {
if (umount(mntpoint) == -1) {
- tst_brkm(TBROK, cleanup, "umount(2) "
- "failed to umount mntpoint %s "
- "errno - %d : %s", Mntpoint,
- TEST_ERRNO,
- strerror(TEST_ERRNO));
+ tst_brkm(TBROK|TERRNO, cleanup,
+ "umount of %s failed", Mntpoint);
}
- tst_resm(TFAIL, "mount(2) failed to produce "
- "expected error; %d, errno:%s got %d",
- testcases[i].exp_errno,
- testcases[i].exp_errval, TEST_ERRNO);
+ tst_resm(TFAIL|TERRNO,
+ "mount(2) failed to produce expected "
+ "error (%d)",
+ exp_enos[i]);
}
- TEST_ERROR_LOG(TEST_ERRNO);
-
(void)cleanup_test(i);
} /* End of TEST CASE LOOPING. */
@@ -254,8 +214,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
-
+ tst_exit();
} /* End main */
/*
@@ -287,9 +246,8 @@
Device = Path;
return 0;
} else {
- tst_resm(TWARN, "mknod(2) failed to creat device %s "
- "errno = %d : %s", Path, TEST_ERRNO,
- strerror(TEST_ERRNO));
+ tst_resm(TWARN, "mknod(2) failed to create device: %s",
+ Path);
return 1;
}
case 2:
@@ -297,9 +255,9 @@
TEST(mount(Device, Mntpoint, Fstype, 0, NULL));
if (TEST_RETURN != 0) {
- tst_resm(TWARN, "mount(2) failed to mount device %s "
- "errno = %d : %s", device, TEST_ERRNO,
- strerror(TEST_ERRNO));
+ tst_resm(TWARN|TTERRNO,
+ "mount(2) failed to mount device %s",
+ device);
return 1;
}
return 0;
@@ -308,23 +266,19 @@
TEST(mount(Device, Mntpoint, Fstype, 0, NULL));
if (TEST_RETURN != 0) {
- tst_resm(TWARN, "mount(2) failed to mount device %s "
- "errno = %d : %s", device, TEST_ERRNO,
- strerror(TEST_ERRNO));
+ tst_resm(TWARN|TTERRNO,
+ "mount(2) failed to mount device %s", device);
return 1;
}
if (getcwd(Path, PATH_MAX) == NULL) {
- tst_resm(TWARN, "getcwd() failed to get current working"
- " directory errno = %d : %s", errno,
- strerror(errno));
+ tst_resm(TWARN|TERRNO, "getcwd failed");
return 1;
}
sprintf(temp, "/%s/t3_%d", mntpoint, cnt);
strcat(Path, temp);
if ((fd = open(Path, O_CREAT | O_RDWR, S_IRWXU)) == -1) {
- tst_resm(TWARN, "open() failed to create a file "
- " %s errno = %d : %s", Path, errno,
- strerror(errno));
+ tst_resm(TWARN|TERRNO, "open() failed to create %s",
+ Path);
return 1;
}
Flag = MS_REMOUNT | MS_RDONLY;
@@ -376,17 +330,13 @@
/* Setup for mount(2) returning errno ENOTDIR. */
if (getcwd(Path, PATH_MAX) == NULL) {
- tst_resm(TWARN, "getcwd() failed to get current working"
- " directory errno = %d : %s", errno,
- strerror(errno));
+ tst_resm(TWARN, "getcwd failed");
return 1;
}
sprintf(temp, "/t_%d_%d", getpid(), cnt);
strcat(Path, temp);
if ((fd = open(Path, O_CREAT, S_IRWXU)) == -1) {
- tst_resm(TWARN, "open() failed to create a file "
- " %s errno = %d : %s", Path, errno,
- strerror(errno));
+ tst_resm(TWARN, "open failed to create %s", Path);
return 1;
} else {
Mntpoint = Path;
@@ -422,9 +372,7 @@
case 2:
TEST(umount(mntpoint));
if (TEST_RETURN != 0) {
- tst_resm(TWARN, "umount(2) Failed while unmounting"
- " errno %d for testcase %s", TEST_ERRNO,
- testcases[i].exp_errval);
+ tst_resm(TWARN|TTERRNO, "umount failed");
}
break;
case 12:
@@ -440,21 +388,16 @@
/* capture signals */
tst_sig(FORK, DEF_HANDLER, cleanup);
- /* Check whether we are root */
- if (geteuid() != 0) {
- free(Type);
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
- }
+ tst_require_root(NULL);
/* make a temp directory */
tst_tmpdir();
(void)sprintf(mntpoint, "mnt_%d", getpid());
- if (mkdir(mntpoint, DIR_MODE)) {
- tst_brkm(TBROK, cleanup, "mkdir(%s, %#o) failed; "
- "errno = %d: %s", mntpoint, DIR_MODE, errno,
- strerror(errno));
+ if (mkdir(mntpoint, DIR_MODE) == -1) {
+ tst_brkm(TBROK|TERRNO, cleanup, "mkdir(%s, %#o) failed",
+ mntpoint, DIR_MODE);
}
/* set up expected error numbers */
@@ -462,8 +405,6 @@
/* Pause if that option was specified */
TEST_PAUSE;
-
- return;
} /* End setup() */
/*
@@ -482,11 +423,6 @@
/* Remove tmp dir and all files in it. */
tst_rmdir();
-
- /* exit with return code appropriate for results */
- tst_exit();
-
- return;
} /* End cleanup() */
/*
diff --git a/testcases/kernel/syscalls/mount/mount03.c b/testcases/kernel/syscalls/mount/mount03.c
index 9581a4e..94cd766 100644
--- a/testcases/kernel/syscalls/mount/mount03.c
+++ b/testcases/kernel/syscalls/mount/mount03.c
@@ -82,13 +82,14 @@
# define _GNU_SOURCE
#endif
-#include <errno.h>
-#include <sys/mount.h>
#include <sys/types.h>
+#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/wait.h>
-#include <pwd.h>
+#include <assert.h>
+#include <errno.h>
#include <fcntl.h>
+#include <pwd.h>
#include <unistd.h>
#include "test.h"
#include "usctest.h"
@@ -97,7 +98,7 @@
static void setup(void);
static void cleanup(void);
static int test_rwflag(int, int);
-static void setup_uid(void);
+static int setup_uid(void);
char *TCID = "mount03"; /* Test program identifier. */
int TST_TOTAL = 6; /* Total number of test cases. */
@@ -106,14 +107,12 @@
#define DEFAULT_FSTYPE "ext2"
#define TEMP_FILE "temp_file"
-#define FILE_MODE S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
-#define DIR_MODE S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH
-#define SUID_MODE S_ISUID|S_IRUSR|S_IXUSR|S_IXGRP|S_IXOTH
+#define FILE_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)
+#define DIR_MODE (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
+#define SUID_MODE (S_ISUID|S_IRUSR|S_IXUSR|S_IXGRP|S_IXOTH)
static char *Fstype;
-static unsigned long Flag;
-
static char mntpoint[20];
static char *fstype;
static char *device;
@@ -129,18 +128,13 @@
static char file[PATH_MAX]; /* Temporary file */
static char cmd[] = "cp";
-static struct test_case_t {
- char *rwflag_desc; /* error description */
- unsigned long rwflag; /* Expected error no */
- char *rwdesc; /* rwflag */
-} testcases[] = {
- {
- "mount read-only", MS_RDONLY, "MS_RDONLY"}, {
- "disallow access to device special files", MS_NODEV, "MS_NODEV"}, {
- "disallow program execution", MS_NOEXEC, "MS_NOEXEC"}, {
- "writes are synced at once", MS_SYNCHRONOUS, "MS_SYNCHRONOUS"}, {
- "alter flags of a mounted FS", MS_RDONLY, "MS_REMOUNT"}, {
- "ignore suid and sgid bits", MS_NOSUID, "MS_NOSUID"}
+long rwflags[] = {
+ MS_RDONLY,
+ MS_NODEV,
+ MS_NOEXEC,
+ MS_SYNCHRONOUS,
+ MS_RDONLY,
+ MS_NOSUID,
};
static option_t options[] = { /* options supported by mount03 test */
@@ -155,34 +149,30 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
- if ((msg = parse_opts(ac, av, options, &help)) != NULL) {
+ if ((msg = parse_opts(ac, av, options, &help)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
+
/* Check for mandatory option of the testcase */
if (!Dflag) {
- tst_resm(TWARN, "You must specifiy the device used for "
- " mounting with -D option, Run '%s -h' for option "
- " information.", TCID);
- tst_exit();
+ tst_brkm(TBROK, NULL,
+ "you must specify the device used for mounting with -D "
+ "option");
}
if (Tflag) {
Fstype = (char *)malloc(strlen(fstype)+1);
if (Fstype == NULL) {
- tst_brkm(TBROK, NULL, "malloc failed to alloc %d errno "
- " %d ", strlen(fstype)+1, errno);
+ tst_brkm(TBROK|TERRNO, NULL, "malloc failed");
}
- memset(Fstype, 0, strlen(fstype)+1);
+ Fstype[strlen(fstype)] = '\0';
strncpy(Fstype, fstype, strlen(fstype));
} else {
Fstype = (char *)malloc(strlen(DEFAULT_FSTYPE)+1);
if (Fstype == NULL) {
- tst_brkm(TBROK, NULL, "malloc failed to alloc %d errno "
- " %d ", strlen(fstype)+1, errno);
+ tst_brkm(TBROK|TERRNO, NULL, "malloc failed");
}
- memset(Fstype, 0, strlen(DEFAULT_FSTYPE)+1);
strncpy(Fstype, DEFAULT_FSTYPE, strlen(DEFAULT_FSTYPE));
+ Fstype[strlen(DEFAULT_FSTYPE)] = '\0';
}
if (STD_COPIES != 1) {
@@ -202,36 +192,28 @@
Tst_count = 0;
for (i = 0; i < TST_TOTAL; ++i) {
- Flag = testcases[i].rwflag;
/* Call mount(2) */
- TEST(mount(device, mntpoint, Fstype, Flag, NULL));
+ TEST(mount(device, mntpoint, Fstype, rwflags[i], NULL));
/* check return code */
if (TEST_RETURN != 0) {
- TEST_ERROR_LOG(TEST_ERRNO);
- tst_resm(TFAIL, "mount(2) failed errno = %d : "
- "%s", TEST_ERRNO,
- strerror(TEST_ERRNO));
+ tst_resm(TFAIL|TTERRNO, "mount(2) failed");
continue;
}
/* Validate the rwflag */
if (test_rwflag(i, lc) == 1) {
- TEST_ERROR_LOG(TEST_ERRNO);
- tst_resm(TFAIL, "mount(2) Failed while"
- " validating %s", testcases[i].rwdesc);
+ tst_resm(TFAIL, "mount(2) failed while"
+ " validating %ld", rwflags[i]);
} else {
- tst_resm(TPASS, "mount(2) Passed for rwflag"
- " %s - %s", testcases[i].rwdesc,
- testcases[i].rwflag_desc);
+ tst_resm(TPASS, "mount(2) passed with "
+ "rwflag = %ld", rwflags[i]);
}
TEST(umount(mntpoint));
if (TEST_RETURN != 0) {
- tst_brkm(TBROK, cleanup, "umount(2) failed to "
- "to umount %s errno = %d : %s",
- mntpoint, TEST_ERRNO,
- strerror(TEST_ERRNO));
+ tst_brkm(TBROK|TTERRNO, cleanup,
+ "umount(2) failed for %s", mntpoint);
}
} /* End of TEST CASE LOOPING. */
} /* End for TEST_LOOPING */
@@ -239,8 +221,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
-
+ tst_exit();
} /* End main */
/*
@@ -263,9 +244,8 @@
if (errno == EROFS) {
return 0;
} else {
- tst_resm(TWARN, "open(%s) failed with "
- " error %d instead EACCES",
- file, errno);
+ tst_resm(TWARN|TERRNO,
+ "open(%s) didn't fail with EROFS", file);
return 1;
}
}
@@ -281,17 +261,15 @@
if (errno == EACCES) {
return 0;
} else {
- tst_resm(TWARN, "open(%s) "
- "failed with error %d instead "
- "EACCES", file, errno);
+ tst_resm(TWARN|TERRNO,
+ "open(%s) didn't fail with EACCES");
return 1;
}
}
close(fd);
} else {
- tst_resm(TWARN, "mknod(2) failed to creat "
- "device %s errno = %d : %s", file,
- errno, strerror(errno));
+ tst_resm(TWARN|TERRNO, "mknod(2) failed to create %s",
+ file);
return 1;
}
return 1;
@@ -300,18 +278,12 @@
snprintf(file, PATH_MAX, "%stmp1", Path_name);
if ((fd = open(file, O_CREAT | O_RDWR, S_IRWXU)) == -1) {
- tst_resm(TWARN,
- "open() of %s failed with error" " %d : %s",
- file, errno, strerror(errno));
- return 1;
+ tst_resm(TWARN|TERRNO, "opening %s failed", file);
} else {
close(fd);
- if (execve(file, NULL, NULL) == -1) {
- return 0;
- } else {
- return 1;
- }
+ execlp(file, basename(file), NULL);
}
+ return 1;
case 3:
/*
* Validate MS_SYNCHRONOUS flag of mount call.
@@ -324,17 +296,16 @@
snprintf(file, PATH_MAX, "%s%s", Path_name, TEMP_FILE);
if ((fildes = open(file, O_RDWR | O_CREAT, FILE_MODE))
== -1) {
- tst_resm(TWARN, "open(%s, O_RDWR | O_CREAT,"
- " %#o) Failed, errno=%d :%s",
- file, FILE_MODE, errno, strerror(errno));
+ tst_resm(TWARN|TERRNO,
+ "open(%s, O_RDWR|O_CREAT, %#o) failed",
+ file, FILE_MODE);
return 1;
}
/* Write the buffer data into file */
if (write(fildes, write_buffer, strlen(write_buffer)) !=
strlen(write_buffer)) {
- tst_resm(TWARN, "write() failed to write buffer"
- " data to %s", file);
+ tst_resm(TWARN|TERRNO, "writing to %s failed", file);
close(fildes);
return 1;
}
@@ -350,9 +321,8 @@
/* Read the contents of file */
if (read(fildes, read_buffer, sizeof(read_buffer)) > 0) {
if (strcmp(read_buffer, write_buffer)) {
- tst_resm(TWARN, "Data read "
- "from %s doesn't match with"
- " written data", file);
+ tst_resm(TWARN, "Data read from %s and written "
+ "mismatch", file);
close(fildes);
return 1;
} else {
@@ -360,8 +330,7 @@
return 0;
}
} else {
- tst_resm(TWARN, "read() Fails on %s, error=%d",
- file, errno);
+ tst_resm(TWARN|TERRNO, "read() Fails on %s", file);
close(fildes);
return 1;
}
@@ -371,9 +340,7 @@
TEST(mount(device, mntpoint, Fstype, MS_REMOUNT, NULL));
if (TEST_RETURN != 0) {
- tst_resm(TWARN, "mount(2) Failed to remount "
- "errno = %d : %s", TEST_ERRNO,
- strerror(TEST_ERRNO));
+ tst_resm(TWARN|TTERRNO, "mount(2) failed to remount");
return 1;
} else {
snprintf(file, PATH_MAX, "%stmp2", Path_name);
@@ -390,26 +357,30 @@
case 5:
/* Validate MS_NOSUID flag of mount call */
- setup_uid();
- if ((pid = fork()) == 0) {
+ if (setup_uid() != 0) {
+ tst_resm(TBROK|TERRNO, "setup_uid failed");
+ return 1;
+ }
+ switch (pid = fork()) {
+ case -1:
+ tst_resm(TBROK|TERRNO, "fork failed");
+ return 1;
+ case 0:
snprintf(file, PATH_MAX, "%ssetuid_test", Path_name);
if (chmod(file, SUID_MODE) != 0) {
- tst_resm(TWARN, "chmod() failed to "
- "change mode %d errno = %d : %s",
- 4511, TEST_ERRNO,
- strerror(TEST_ERRNO));
+ tst_resm(TWARN, "chmod(%s, %#o) failed",
+ file, SUID_MODE);
}
ltpuser = getpwnam(nobody_uid);
if (setreuid(ltpuser->pw_uid, ltpuser->pw_uid) == -1) {
- tst_resm(TWARN, "seteuid() failed to "
- "change euid to %d errno = %d : %s",
- ltpuser->pw_uid, TEST_ERRNO,
- strerror(TEST_ERRNO));
+ tst_resm(TWARN|TERRNO,
+ "seteuid() failed to change euid to %d",
+ ltpuser->pw_uid);
}
- execve(file, NULL, NULL);
- /* NOT REACHEAD */
- } else {
+ execlp(file, basename(file), NULL);
+ exit(1);
+ default:
waitpid(pid, &status, 0);
if (WIFEXITED(status)) {
/* reset the setup_uid */
@@ -424,17 +395,15 @@
}
/* setup_uid() - performs setup for NOUID test */
-void setup_uid()
+int setup_uid()
{
int pid, status;
char command[PATH_MAX];
switch (pid = fork()) {
case -1:
- tst_resm(TWARN, "Unable to fork a child process"
- " to exec over! Errno:%d, :%s",
- errno, strerror(errno));
- break;
+ tst_resm(TWARN|TERRNO, "fork failed");
+ return 1;
case 0:
Cmd_buffer[0] = cmd;
Cmd_buffer[1] = testhome_path;
@@ -443,18 +412,25 @@
/* Put command into string */
sprintf(command, "%s %s %s", cmd, testhome_path, Path_name);
- /*Run command to cp file to right spot */
- system(command);
-
- /* Must kill child */
- execve(file, NULL, NULL);
-
- /* execve("/bin/cp", Cmd_buffer, environ); */
- exit(errno);
+ /* Run command to cp file to right spot */
+ if (system(command) == 0) {
+ execlp(file, basename(file), NULL);
+ } else {
+ printf("call to %s failed\n", command);
+ }
+ exit(1);
default:
waitpid(pid, &status, 0);
+ if (WIFEXITED(status)) {
+ return WEXITSTATUS(status);
+ } else if (WIFSIGNALED(status)) {
+ return WTERMSIG(status);
+ } else {
+ /* Should be 0. */
+ assert (status == 0);
+ return 0;
+ }
}
- return;
}
/* setup() - performs all ONE TIME setup for this test */
@@ -469,7 +445,7 @@
/* Check whether we are root */
if (geteuid() != 0) {
free(Fstype);
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* Test home directory */
@@ -482,19 +458,16 @@
(void)sprintf(mntpoint, "mnt_%d", getpid());
if (mkdir(mntpoint, DIR_MODE)) {
- tst_brkm(TBROK, cleanup, "mkdir(%s, %#o) failed; "
- "errno = %d: %s", mntpoint, DIR_MODE, errno,
- strerror(errno));
+ tst_brkm(TBROK|TERRNO, cleanup, "mkdir(%s, %#o) failed",
+ mntpoint, DIR_MODE);
}
/* Get the current working directory of the process */
if (getcwd(Path_name, sizeof(Path_name)) == NULL) {
- tst_brkm(TBROK, cleanup,
- "getcwd(3) fails to get working directory of process");
+ tst_brkm(TBROK, cleanup, "getcwd failed");
}
if (chmod(Path_name, DIR_MODE) != 0) {
- tst_brkm(TBROK, cleanup, "chmod() failed to change mode %#o "
- "errno = %d : %s", DIR_MODE, TEST_ERRNO,
- strerror(TEST_ERRNO));
+ tst_brkm(TBROK, cleanup, "chmod(%s, %#o) failed",
+ Path_name, DIR_MODE);
}
snprintf(file, PATH_MAX, "%ssetuid_test", Path_name);
if (stat(file, &setuid_test_stat) < 0) {
@@ -505,8 +478,8 @@
tst_brkm(TBROK, cleanup,
"chown for setuid_test failed");
}
- if (setuid_test_stat.st_mode != 04511 &&
- chmod(file, 04511) < 0) {
+ if (setuid_test_stat.st_mode != SUID_MODE &&
+ chmod(file, SUID_MODE) < 0) {
tst_brkm(TBROK, cleanup,
"setuid for setuid_test failed");
}
@@ -519,7 +492,6 @@
snprintf(Path_name, PATH_MAX, "%s/%s/", Path_name, mntpoint);
strcpy(testhome_path, test_home);
-
strcat(testhome_path, "/setuid_test");
/* Pause if that option was specified */
@@ -543,9 +515,6 @@
/* Remove tmp dir and all files in it */
tst_rmdir();
-
- /* exit with return code appropriate for results */
- tst_exit();
} /* End cleanup() */
/*
diff --git a/testcases/kernel/syscalls/mount/mount04.c b/testcases/kernel/syscalls/mount/mount04.c
index dceaf2d..de51a1f 100644
--- a/testcases/kernel/syscalls/mount/mount04.c
+++ b/testcases/kernel/syscalls/mount/mount04.c
@@ -131,8 +131,7 @@
/* Check for mandatory option of the testcase */
if (Dflag == 0) {
tst_brkm(TBROK, NULL, "You must specifiy the device used for "
- " mounting with -D option, Run '%s -h' for option "
- " information.", TCID);
+ " mounting with -D option.");
tst_exit();
}
@@ -200,7 +199,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -216,7 +215,7 @@
/* Check whether we are root */
if (geteuid() != 0) {
free(Type);
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
diff --git a/testcases/kernel/syscalls/mount/setuid_test.c b/testcases/kernel/syscalls/mount/setuid_test.c
index 14562d5..0364191 100644
--- a/testcases/kernel/syscalls/mount/setuid_test.c
+++ b/testcases/kernel/syscalls/mount/setuid_test.c
@@ -32,7 +32,7 @@
/* Save the effective and real UIDs. */
-static uid_t euid, ruid;
+static uid_t ruid;
/* Restore the effective UID to its original value. */
@@ -55,9 +55,8 @@
{
int exit_status;
-/* Save the real and effective user IDs. */
+ /* Save the real and effective user IDs. */
ruid = getuid();
- euid = geteuid();
exit_status = do_setuid();
exit(exit_status);
diff --git a/testcases/kernel/syscalls/move_pages/move_pages01.c b/testcases/kernel/syscalls/move_pages/move_pages01.c
index b380ce0..5aa3be3 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages01.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages01.c
@@ -76,7 +76,7 @@
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /* NOTREACHED */
+
}
setup();
@@ -149,4 +149,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/move_pages/move_pages02.c b/testcases/kernel/syscalls/move_pages/move_pages02.c
index 4e1c342..a9a6212 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages02.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages02.c
@@ -77,7 +77,7 @@
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /* NOTREACHED */
+
}
setup();
@@ -161,4 +161,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/move_pages/move_pages03.c b/testcases/kernel/syscalls/move_pages/move_pages03.c
index 1cbfd26..ad13e5c 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages03.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages03.c
@@ -115,7 +115,7 @@
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /* NOTREACHED */
+
}
setup();
@@ -227,4 +227,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/move_pages/move_pages04.c b/testcases/kernel/syscalls/move_pages/move_pages04.c
index d96321e..5a4459d 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages04.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages04.c
@@ -83,7 +83,7 @@
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /* NOTREACHED */
+
}
setup();
@@ -180,4 +180,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/move_pages/move_pages05.c b/testcases/kernel/syscalls/move_pages/move_pages05.c
index d09d54d..3e94ed3 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages05.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages05.c
@@ -116,7 +116,7 @@
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /* NOTREACHED */
+
}
setup();
@@ -241,4 +241,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/move_pages/move_pages06.c b/testcases/kernel/syscalls/move_pages/move_pages06.c
index d426d6c..8c8782d 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages06.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages06.c
@@ -77,7 +77,7 @@
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /* NOTREACHED */
+
}
setup();
@@ -157,4 +157,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/move_pages/move_pages07.c b/testcases/kernel/syscalls/move_pages/move_pages07.c
index 6d2221d..7bb7ee2 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages07.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages07.c
@@ -77,7 +77,7 @@
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /* NOTREACHED */
+
}
setup();
@@ -168,4 +168,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/move_pages/move_pages08.c b/testcases/kernel/syscalls/move_pages/move_pages08.c
index 50d6f7b..e155004 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages08.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages08.c
@@ -77,7 +77,7 @@
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /* NOTREACHED */
+
}
setup();
@@ -156,4 +156,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/move_pages/move_pages09.c b/testcases/kernel/syscalls/move_pages/move_pages09.c
index 107c80a..8a0909a 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages09.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages09.c
@@ -77,7 +77,7 @@
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /* NOTREACHED */
+
}
setup();
@@ -155,4 +155,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/move_pages/move_pages10.c b/testcases/kernel/syscalls/move_pages/move_pages10.c
index 8ba8a35..c800b8a 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages10.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages10.c
@@ -77,7 +77,7 @@
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /* NOTREACHED */
+
}
setup();
@@ -156,4 +156,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/move_pages/move_pages11.c b/testcases/kernel/syscalls/move_pages/move_pages11.c
index a9c3017..ea2d665 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages11.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages11.c
@@ -115,7 +115,7 @@
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /* NOTREACHED */
+
}
setup();
@@ -246,4 +246,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/mprotect/mprotect01.c b/testcases/kernel/syscalls/mprotect/mprotect01.c
index 60c7c5a..3f881ec 100644
--- a/testcases/kernel/syscalls/mprotect/mprotect01.c
+++ b/testcases/kernel/syscalls/mprotect/mprotect01.c
@@ -121,7 +121,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -166,7 +170,7 @@
}
cleanup();
return 0;
- /*NOTREACHED*/}
+ }
#else
@@ -195,7 +199,7 @@
addr2 = (char *)malloc(PAGESIZE);
if (addr2 == NULL) {
tst_brkm(TINFO, cleanup, "malloc failed");
- /*NOTREACHED*/}
+ }
addr2++; /* Ensure addr2 is not page aligned */
}
@@ -207,7 +211,7 @@
fd = open("/etc/passwd", O_RDONLY);
if (fd < 0) {
tst_brkm(TBROK, cleanup, "open failed");
- /*NOTREACHED*/}
+ }
/*
* mmap the PAGESIZE bytes as read only.
@@ -215,7 +219,7 @@
addr3 = mmap(0, PAGESIZE, PROT_READ, MAP_SHARED, fd, 0);
if (addr3 < 0) {
tst_brkm(TBROK, cleanup, "mmap failed");
- /*NOTREACHED*/}
+ }
}
/*
diff --git a/testcases/kernel/syscalls/mprotect/mprotect02.c b/testcases/kernel/syscalls/mprotect/mprotect02.c
index cd345db..2cecbb4 100644
--- a/testcases/kernel/syscalls/mprotect/mprotect02.c
+++ b/testcases/kernel/syscalls/mprotect/mprotect02.c
@@ -87,7 +87,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -100,7 +104,7 @@
if ((fd = open(file1, O_RDWR | O_CREAT, 0777)) < 0) { //mode must be specified when O_CREATE is in the flag
tst_brkm(TBROK, cleanup, "open failed");
- /*NOTREACHED*/}
+ }
(void)write(fd, buf, strlen(buf));
/*
@@ -109,7 +113,7 @@
addr = mmap(0, strlen(buf), PROT_READ, MAP_SHARED, fd, 0);
if (addr < 0) {
tst_brkm(TBROK, cleanup, "mmap failed");
- /*NOTREACHED*/}
+ }
if ((pid = FORK_OR_VFORK()) == -1) {
tst_brkm(TBROK, cleanup, "fork() #1 failed");
@@ -119,17 +123,17 @@
(void)memcpy((void *)addr, (void *)buf, strlen(buf));
tst_resm(TINFO, "memcpy() did not generate SIGSEGV");
exit(1);
- /*NOTREACHED*/}
+ }
/* parent */
(void)waitpid(pid, &status, 0);
if (WIFEXITED(status) == 0) {
tst_brkm(TBROK, cleanup, "chiled exited abnormally");
- /*NOTREACHED*/}
+ }
/* exit status should be 1 */
if (WEXITSTATUS(status) != 1) {
tst_brkm(TBROK, cleanup, "child failed");
- /*NOTREACHED*/}
+ }
/*
* Change the protection to WRITE.
@@ -154,7 +158,7 @@
if (WIFEXITED(status) == 0) {
tst_brkm(TBROK, cleanup, "child exited "
"abnormally");
- /*NOTREACHED*/}
+ }
/*
* if we get a SIGSEGV, the exit status
* will be 1.
@@ -187,7 +191,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
#else
diff --git a/testcases/kernel/syscalls/mprotect/mprotect03.c b/testcases/kernel/syscalls/mprotect/mprotect03.c
index 0584a2c..c7f0304 100644
--- a/testcases/kernel/syscalls/mprotect/mprotect03.c
+++ b/testcases/kernel/syscalls/mprotect/mprotect03.c
@@ -88,7 +88,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -101,7 +105,7 @@
if ((fd = open(file1, O_RDWR | O_CREAT, 0777)) < 0) { //mode must be specified when O_CREAT is in the flag
tst_brkm(TBROK, cleanup, "open failed");
- /*NOTREACHED*/}
+ }
(void)write(fd, buf, strlen(buf));
@@ -112,7 +116,7 @@
fd, 0);
if (addr < 0) {
tst_brkm(TBROK, cleanup, "mmap failed");
- /*NOTREACHED*/}
+ }
/*
* Try to change the protection to WRITE.
@@ -131,7 +135,7 @@
tst_resm(TINFO, "memcpy() did "
"not generate SIGSEGV");
exit(1);
- /*NOTREACHED*/}
+ }
/* parent */
(void)waitpid(pid, &status, 0);
@@ -148,7 +152,7 @@
} else {
tst_resm(TFAIL, "mprotect failed "
"unexpectedly, errno: %d", errno);
- /*NOTREACHED*/}
+ }
/* clean up things in case we are looping */
if (munmap(addr, strlen(buf)) == -1) {
diff --git a/testcases/kernel/syscalls/mq_notify/mq_notify01.c b/testcases/kernel/syscalls/mq_notify/mq_notify01.c
index d7cbc42..3f65e1d 100644
--- a/testcases/kernel/syscalls/mq_notify/mq_notify01.c
+++ b/testcases/kernel/syscalls/mq_notify/mq_notify01.c
@@ -410,9 +410,42 @@
progname = basename(av[0]);
+<<<<<<< HEAD
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ /* parse standard options */
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+ tst_exit();
+ }
+
+ setup();
+
+ /* Check looping state if -i option given */
+ for (lc = 0; TEST_LOOPING(lc); ++lc) {
+ Tst_count = 0;
+ for (testno = 0; testno < TST_TOTAL; ++testno) {
+ TEST(c = getopt_long(ac, av, "dh", long_options, NULL));
+ while (TEST_RETURN != -1) {
+ switch (c) {
+ case 'd':
+ opt_debug = 1;
+ break;
+ default:
+ usage(progname);
+
+ }
+ }
+
+
+ if (ac != optind) {
+ tst_resm(TINFO,"Options are not match.");
+ usage(progname);
+
+ }
+>>>>>>> master
setup();
diff --git a/testcases/kernel/syscalls/mq_open/mq_open01.c b/testcases/kernel/syscalls/mq_open/mq_open01.c
index 2c7d257..07e5e78 100644
--- a/testcases/kernel/syscalls/mq_open/mq_open01.c
+++ b/testcases/kernel/syscalls/mq_open/mq_open01.c
@@ -433,7 +433,7 @@
(ret == 0) ? "OK" : "NG");
result |= ret;
}
-
+
/*
* Check results
*/
diff --git a/testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c b/testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c
index 9d00f39..a69a39a 100644
--- a/testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c
+++ b/testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c
@@ -88,7 +88,7 @@
{
if (sig == SIGINT)
return;
- // NOTREACHED
+
return;
}
@@ -449,6 +449,7 @@
int main(int ac, char **av) {
int result = RESULT_OK;
+<<<<<<< HEAD
int i;
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
@@ -490,5 +491,82 @@
}
}
cleanup();
+=======
+ int c;
+ int i;
+ int lc; /* loop counter */
+ char *msg; /* message returned from parse_opts */
+
+ struct option long_options[] = {
+ { "debug", no_argument, 0, 'd' },
+ { "help", no_argument, 0, 'h' },
+ { NULL, 0, NULL, 0 }
+ };
+
+ progname = strchr(av[0], '/');
+ progname = progname ? progname + 1 : av[0];
+
+ /* parse standard options */
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+ tst_exit();
+ }
+
+ setup();
+
+ /* Check looping state if -i option given */
+ for (lc = 0; TEST_LOOPING(lc); ++lc) {
+ Tst_count = 0;
+ for (testno = 0; testno < TST_TOTAL; ++testno) {
+ TEST(c = getopt_long(ac, av, "dh", long_options, NULL));
+ while (TEST_RETURN != -1) {
+ switch (c) {
+ case 'd':
+ opt_debug = 1;
+ break;
+ default:
+ usage(progname);
+
+ }
+ }
+
+
+ if (ac != optind) {
+ tst_resm(TINFO,"Options are not match.");
+ usage(progname);
+
+ }
+
+ /*
+ * Execute test
+ */
+ for (i = 0; i < (int)(sizeof(tcase) / sizeof(tcase[0])); i++) {
+ int ret;
+ tst_resm(TINFO,"(case%02d) START", i);
+ ret = do_test(&tcase[i]);
+ tst_resm(TINFO,"(case%02d) END => %s", i, (ret == 0) ? "OK" : "NG");
+ result |= ret;
+ }
+
+ /*
+ * Check results
+ */
+ switch(result) {
+ case RESULT_OK:
+ tst_resm(TPASS, "mq_timedreceive call succeeded");
+ break;
+
+ default:
+ tst_resm(TFAIL, "%s failed - errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO));
+ tst_resm(TINFO,"NG");
+ cleanup();
+ tst_exit();
+ break;
+ }
+
+ }
+ }
+ cleanup();
+>>>>>>> master
tst_exit();
}
diff --git a/testcases/kernel/syscalls/mq_unlink/mq_unlink01.c b/testcases/kernel/syscalls/mq_unlink/mq_unlink01.c
index 5966971..4f3d861 100644
--- a/testcases/kernel/syscalls/mq_unlink/mq_unlink01.c
+++ b/testcases/kernel/syscalls/mq_unlink/mq_unlink01.c
@@ -1,49 +1,49 @@
/******************************************************************************/
-/* Copyright (c) Crackerjack Project., 2007-2008 ,Hitachi, Ltd */
-/* Author(s): Takahiro Yasui <takahiro.yasui.mp@hitachi.com>, */
+/* Copyright (c) Crackerjack Project., 2007-2008 ,Hitachi, Ltd */
+/* Author(s): Takahiro Yasui <takahiro.yasui.mp@hitachi.com>, */
/* Yumiko Sugita <yumiko.sugita.yf@hitachi.com>, */
/* Satoshi Fujiwara <sa-fuji@sdl.hitachi.co.jp> */
-/* */
+/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
-/* the Free Software Foundation; either version 2 of the License, or */
-/* (at your option) any later version. */
-/* */
-/* This program is distributed in the hope that it will be useful, */
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */
-/* the GNU General Public License for more details. */
-/* */
-/* You should have received a copy of the GNU General Public License */
-/* along with this program; if not, write to the Free Software */
+/* the Free Software Foundation; either version 2 of the License, or */
+/* (at your option) any later version. */
+/* */
+/* This program is distributed in the hope that it will be useful, */
+/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
+/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */
+/* the GNU General Public License for more details. */
+/* */
+/* You should have received a copy of the GNU General Public License */
+/* along with this program; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* */
+/* */
/******************************************************************************/
/******************************************************************************/
-/* */
-/* File: mq_ulink01.c */
-/* */
-/* Description: This tests the mq_ulink() syscall */
+/* */
+/* File: mq_ulink01.c */
+/* */
+/* Description: This tests the mq_ulink() syscall */
/* */
/* */
/* */
/* */
/* */
-/* */
-/* Usage: <for command-line> */
-/* mq_ulink01 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
-/* where, -c n : Run n copies concurrently. */
-/* -e : Turn on errno logging. */
-/* -i n : Execute test n times. */
-/* -I x : Execute test for x seconds. */
-/* -P x : Pause for x seconds between iterations. */
-/* -t : Turn on syscall timing. */
-/* */
-/* Total Tests: 1 */
-/* */
-/* Test Name: mq_ulink01 */
-/* History: Porting from Crackerjack to LTP is done by */
-/* Manas Kumar Nayak maknayak@in.ibm.com> */
+/* */
+/* Usage: <for command-line> */
+/* mq_ulink01 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
+/* where, -c n : Run n copies concurrently. */
+/* -e : Turn on errno logging. */
+/* -i n : Execute test n times. */
+/* -I x : Execute test for x seconds. */
+/* -P x : Pause for x seconds between iterations. */
+/* -t : Turn on syscall timing. */
+/* */
+/* Total Tests: 1 */
+/* */
+/* Test Name: mq_ulink01 */
+/* History: Porting from Crackerjack to LTP is done by */
+/* Manas Kumar Nayak maknayak@in.ibm.com> */
/******************************************************************************/
#include <sys/syscall.h>
@@ -69,62 +69,62 @@
#include "linux_syscall_numbers.h"
/* Extern Global Variables */
-extern int Tst_count; /* counter for tst_xxx routines. */
-extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */
+extern int Tst_count; /* counter for tst_xxx routines. */
+extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */
/* Global Variables */
char *TCID = "mq_ulink01"; /* Test program identifier.*/
int testno;
-int TST_TOTAL = 1; /* total number of tests in this file. */
+int TST_TOTAL = 1; /* total number of tests in this file. */
/* Extern Global Functions */
/******************************************************************************/
-/* */
-/* Function: cleanup */
-/* */
+/* */
+/* Function: cleanup */
+/* */
/* Description: Performs all one time clean up for this test on successful */
-/* completion, premature exit or failure. Closes all temporary */
-/* files, removes all temporary directories exits the test with */
-/* appropriate return code by calling tst_exit() function. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
+/* completion, premature exit or failure. Closes all temporary */
+/* files, removes all temporary directories exits the test with */
+/* appropriate return code by calling tst_exit() function. */
+/* */
+/* Input: None. */
+/* */
+/* Output: None. */
+/* */
/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */
-/* On success - Exits calling tst_exit(). With '0' return code. */
-/* */
+/* On success - Exits calling tst_exit(). With '0' return code. */
+/* */
/******************************************************************************/
extern void cleanup() {
- /* Remove tmp dir and all files in it */
- TEST_CLEANUP;
- tst_rmdir();
+ /* Remove tmp dir and all files in it */
+ TEST_CLEANUP;
+ tst_rmdir();
}
/* Local Functions */
/******************************************************************************/
-/* */
-/* Function: setup */
-/* */
+/* */
+/* Function: setup */
+/* */
/* Description: Performs all one time setup for this test. This function is */
-/* typically used to capture signals, create temporary dirs */
-/* and temporary files that may be used in the course of this */
-/* test. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits by calling cleanup(). */
-/* On success - returns 0. */
-/* */
+/* typically used to capture signals, create temporary dirs */
+/* and temporary files that may be used in the course of this */
+/* test. */
+/* */
+/* Input: None. */
+/* */
+/* Output: None. */
+/* */
+/* Return: On failure - Exits by calling cleanup(). */
+/* On success - returns 0. */
+/* */
/******************************************************************************/
void setup() {
- tst_require_root(tst_exit);
- /* Capture signals if any */
- /* Create temporary directories */
- TEST_PAUSE;
- tst_tmpdir();
+ tst_require_root(tst_exit);
+ /* Capture signals if any */
+ /* Create temporary directories */
+ TEST_PAUSE;
+ tst_tmpdir();
}
@@ -143,10 +143,10 @@
*/
struct test_case {
char *user;
- char *qname;
- int ttype;
- int ret;
- int err;
+ char *qname;
+ int ttype;
+ int ret;
+ int err;
};
@@ -154,53 +154,53 @@
*
* test status of errors on man page
*
-* EACCES v (permission is denied)
+* EACCES v (permission is denied)
* ENAMETOOLONG v (too long name length)
-* ENOENT v (named message queue does not exist)
+* ENOENT v (named message queue does not exist)
*/
static struct test_case tcase[] = {
{ // case00
- .ttype = NORMAL,
- .qname = QUEUE_NAME,
- .ret = 0,
- .err = 0,
- },
- { // case01
- .ttype = NORMAL,
- .user = "nobody",
- .qname = QUEUE_NAME,
- .ret = -1,
- .err = EACCES,
- },
- { // case02
- .ttype = NORMAL,
- // 0 1 2 3
- // 0123456789012345678901234567890123456789
- .qname = "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
- "aaaaaaaaaaaaaaa",
- .ret = -1,
- .err = ENOENT,
- },
+ .ttype = NORMAL,
+ .qname = QUEUE_NAME,
+ .ret = 0,
+ .err = 0,
+ },
+ { // case01
+ .ttype = NORMAL,
+ .user = "nobody",
+ .qname = QUEUE_NAME,
+ .ret = -1,
+ .err = EACCES,
+ },
+ { // case02
+ .ttype = NORMAL,
+ // 0 1 2 3
+ // 0123456789012345678901234567890123456789
+ .qname = "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaa",
+ .ret = -1,
+ .err = ENOENT,
+ },
{ // case03
- .ttype = NORMAL,
- // 0 1 2 3
- // 0123456789012345678901234567890123456789
- .qname = "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
- "aaaaaaaaaaaaaaaa",
- .ret = -1,
- .err = ENAMETOOLONG,
- },
+ .ttype = NORMAL,
+ // 0 1 2 3
+ // 0123456789012345678901234567890123456789
+ .qname = "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaa",
+ .ret = -1,
+ .err = ENAMETOOLONG,
+ },
};
/*
@@ -213,69 +213,64 @@
static int do_test(struct test_case *tc)
{
- int sys_ret;
- int sys_errno;
- int result = RESULT_OK;
+ int sys_ret;
+ int sys_errno;
+ int result = RESULT_OK;
int rc, fd1 = -1, fd2 = -1;
- uid_t old_uid = -1;
+ uid_t old_uid = -1;
- /*
- * When test ended with SIGTERM etc, mq discriptor is left remains.
- * So we delete it first.
- */
- TEST(mq_unlink(QUEUE_NAME));
+ /*
+ * When test ended with SIGTERM etc, mq discriptor is left remains.
+ * So we delete it first.
+ */
+ TEST(mq_unlink(QUEUE_NAME));
- /*
- * Open message queue
- */
- TEST(rc = mq_open(QUEUE_NAME, O_CREAT|O_EXCL|O_RDWR, S_IRWXU, NULL));
- if (TEST_RETURN < 0) {
- tst_resm(TFAIL, "mq_open failed - errno = %d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
- result = 1;
- goto EXIT;
- }
- fd1 = rc;
+ /*
+ * Open message queue
+ */
+ rc = mq_open(QUEUE_NAME, O_CREAT|O_EXCL|O_RDWR, S_IRWXU, NULL);
+ if (rc == -1) {
+ tst_resm(TFAIL|TTERRNO, "mq_open failed");
+ result = 1;
+ goto EXIT;
+ }
+ fd1 = rc;
- /*
- * Change effective user id
- */
- if (tc->user != NULL) {
- TEST(rc = setup_euid(tc->user, &old_uid));
- if (TEST_RETURN < 0) {
- result = 1;
- goto EXIT;
- }
- }
+ /*
+ * Change effective user id
+ */
+ if (tc->user != NULL) {
+ TEST(rc = setup_euid(tc->user, &old_uid));
+ if (TEST_RETURN < 0) {
+ result = 1;
+ goto EXIT;
+ }
+ }
-/*
- * Execute system call
- */
- //tst_resm(TINFO,"PATH_MAX: %d\n", PATH_MAX);
- //tst_resm(TINFO,"NAME_MAX: %d\n", NAME_MAX);
- errno = 0;
- TEST(sys_ret = mq_unlink(tc->qname));
- sys_errno = errno;
- if (sys_ret >= 0)
- fd2 = sys_ret;
+ /*
+ * Execute system call
+ */
+ errno = 0;
+ TEST(sys_ret = mq_unlink(tc->qname));
+ sys_errno = errno;
+ if (sys_ret >= 0)
+ fd2 = sys_ret;
- /*
- * Check results
- */
- result |= (sys_errno != tc->err);
- PRINT_RESULT(sys_ret >= 0, tc->ret, tc->err, sys_ret, sys_errno);
+ /*
+ * Check results
+ */
+ result |= (sys_errno != tc->err);
+ PRINT_RESULT(sys_ret >= 0, tc->ret, tc->err, sys_ret, sys_errno);
EXIT:
- if (tc->user != NULL && old_uid != -1)
- cleanup_euid(old_uid);
+ if (tc->user != NULL && old_uid != -1)
+ cleanup_euid(old_uid);
- if (fd1 >= 0)
- close(fd1);
- if (fd2 >= 0)
- close(fd2);
- if (fd1 >= 0)
- mq_unlink(QUEUE_NAME);
-
- return result;
+ if (fd1 >= 0)
+ close(fd1);
+ if (fd2 >= 0)
+ close(fd2);
+ mq_unlink(QUEUE_NAME);
}
@@ -286,49 +281,36 @@
int main(int ac, char **av) {
int result = RESULT_OK;
- int i;
- int lc; /* loop counter */
- char *msg; /* message returned from parse_opts */
+ int i;
+ int lc;
+ char *msg;
- /* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+ /* parse standard options */
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- setup();
+ setup();
- /* Check looping state if -i option given */
- for (lc = 0; TEST_LOOPING(lc); ++lc) {
- Tst_count = 0;
- for (testno = 0; testno < TST_TOTAL; ++testno) {
+ /* Check looping state if -i option given */
+ for (lc = 0; TEST_LOOPING(lc); ++lc) {
+ Tst_count = 0;
+ for (testno = 0; testno < TST_TOTAL; ++testno) {
+
+ int ret;
+
+ ret = 0;
/*
* Execute test
*/
- for (i = 0; i < (int)(sizeof(tcase) / sizeof(tcase[0])); i++) {
- int ret;
- tst_resm(TINFO,"(case%02d) START", i);
- ret = do_test(&tcase[i]);
- tst_resm(TINFO,"(case%02d) END => %s", i,
- (ret == 0) ? "OK" : "NG");
- result |= ret;
- }
-
- /*
- * Check results
- */
- switch(result) {
- case RESULT_OK:
- tst_resm(TPASS, "mq_unlink call succeeded");
- break;
+ for (i = 0; ret == 0 &&
+ i < (int)(sizeof(tcase) / sizeof(tcase[0])); i++) {
+ ret = do_test(&tcase[i]);
+ }
- default:
- tst_resm(TFAIL|TTERRNO, "mq_unlink failed");
- break;
- }
-
- }
- }
- cleanup();
+ }
+ }
+ cleanup();
tst_exit();
}
diff --git a/testcases/kernel/syscalls/mremap/mremap01.c b/testcases/kernel/syscalls/mremap/mremap01.c
index a816bf7..77ae73f 100644
--- a/testcases/kernel/syscalls/mremap/mremap01.c
+++ b/testcases/kernel/syscalls/mremap/mremap01.c
@@ -104,9 +104,15 @@
int ind; /* counter variable */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Check looping state if -i option given */
@@ -172,7 +178,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
/*
@@ -198,7 +204,7 @@
/* Get the system page size */
if ((pagesz = getpagesize()) < 0) {
- tst_brkm(TFAIL, tst_exit,
+ tst_brkm(TFAIL, NULL,
"getpagesize() fails to get system page size");
}
diff --git a/testcases/kernel/syscalls/mremap/mremap02.c b/testcases/kernel/syscalls/mremap/mremap02.c
index 2d6c1d0..7021118 100644
--- a/testcases/kernel/syscalls/mremap/mremap02.c
+++ b/testcases/kernel/syscalls/mremap/mremap02.c
@@ -99,9 +99,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform global setup for test */
@@ -154,7 +160,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -175,7 +181,7 @@
/* Get the system page size */
if ((memsize = getpagesize()) < 0) {
- tst_brkm(TFAIL, tst_exit,
+ tst_brkm(TFAIL, NULL,
"getpagesize() fails to get system page size");
}
diff --git a/testcases/kernel/syscalls/mremap/mremap03.c b/testcases/kernel/syscalls/mremap/mremap03.c
index a6a96a3..ec03571 100644
--- a/testcases/kernel/syscalls/mremap/mremap03.c
+++ b/testcases/kernel/syscalls/mremap/mremap03.c
@@ -101,9 +101,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform global setup for test */
@@ -157,7 +163,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -179,7 +185,7 @@
/* Get the system page size */
if ((page_sz = getpagesize()) < 0) {
- tst_brkm(TFAIL, tst_exit,
+ tst_brkm(TFAIL, NULL,
"getpagesize() fails to get system page size");
}
diff --git a/testcases/kernel/syscalls/mremap/mremap04.c b/testcases/kernel/syscalls/mremap/mremap04.c
index ff7795f..deb1d6a 100644
--- a/testcases/kernel/syscalls/mremap/mremap04.c
+++ b/testcases/kernel/syscalls/mremap/mremap04.c
@@ -111,9 +111,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform global setup for test */
@@ -168,7 +174,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
/*
@@ -198,7 +204,7 @@
/* Get the system page size */
if ((memsize = getpagesize()) < 0) {
- tst_brkm(TBROK, tst_exit,
+ tst_brkm(TBROK, NULL,
"getpagesize() failed to get system page size");
}
@@ -214,7 +220,7 @@
*/
shmid = shmget(shmkey, newsize, IPC_CREAT | SHM_MODE);
if (shmid == -1) {
- tst_brkm(TBROK, tst_exit, "shmget() Failed to create a shared "
+ tst_brkm(TBROK, NULL, "shmget() Failed to create a shared "
"memory, error:%d", errno);
}
diff --git a/testcases/kernel/syscalls/msync/msync01.c b/testcases/kernel/syscalls/msync/msync01.c
index 9b38220..19045b4 100644
--- a/testcases/kernel/syscalls/msync/msync01.c
+++ b/testcases/kernel/syscalls/msync/msync01.c
@@ -96,9 +96,15 @@
int nread = 0, count, err_flg = 0;
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Check looping state if -i option given */
@@ -183,7 +189,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/msync/msync02.c b/testcases/kernel/syscalls/msync/msync02.c
index 94d96f8..2cd13d9 100644
--- a/testcases/kernel/syscalls/msync/msync02.c
+++ b/testcases/kernel/syscalls/msync/msync02.c
@@ -93,9 +93,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Check looping state if -i option given */
@@ -151,7 +157,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/msync/msync03.c b/testcases/kernel/syscalls/msync/msync03.c
index 7bc3891..ca1afc5 100644
--- a/testcases/kernel/syscalls/msync/msync03.c
+++ b/testcases/kernel/syscalls/msync/msync03.c
@@ -88,9 +88,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform global setup for test */
@@ -135,7 +141,7 @@
/* Call cleanup() to exit the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/msync/msync04.c b/testcases/kernel/syscalls/msync/msync04.c
index a72baa6..9061f8e 100644
--- a/testcases/kernel/syscalls/msync/msync04.c
+++ b/testcases/kernel/syscalls/msync/msync04.c
@@ -94,9 +94,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
TEST_EXP_ENOS(exp_enos);
@@ -146,7 +152,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/msync/msync05.c b/testcases/kernel/syscalls/msync/msync05.c
index 30a7b04..1e0a257 100644
--- a/testcases/kernel/syscalls/msync/msync05.c
+++ b/testcases/kernel/syscalls/msync/msync05.c
@@ -88,9 +88,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform global setup for test */
@@ -135,7 +141,7 @@
/* Call test cleanup to exit the test */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/munlock/munlock01.c b/testcases/kernel/syscalls/munlock/munlock01.c
index d5524fb..3874d47 100644
--- a/testcases/kernel/syscalls/munlock/munlock01.c
+++ b/testcases/kernel/syscalls/munlock/munlock01.c
@@ -162,7 +162,7 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* set the expected errnos... */
diff --git a/testcases/kernel/syscalls/munlockall/munlockall01.c b/testcases/kernel/syscalls/munlockall/munlockall01.c
index d51fae0..3b6cd94 100644
--- a/testcases/kernel/syscalls/munlockall/munlockall01.c
+++ b/testcases/kernel/syscalls/munlockall/munlockall01.c
@@ -137,7 +137,7 @@
TEST_EXP_ENOS(exp_enos);
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be tested as root");
+ tst_brkm(TBROK, NULL, "Test must be tested as root");
}
/* Pause if that option was specified */
diff --git a/testcases/kernel/syscalls/munlockall/munlockall02.c b/testcases/kernel/syscalls/munlockall/munlockall02.c
index b48bc22..0c4901f 100644
--- a/testcases/kernel/syscalls/munlockall/munlockall02.c
+++ b/testcases/kernel/syscalls/munlockall/munlockall02.c
@@ -137,15 +137,15 @@
/* switch to nobody user */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
if ((ltpuser = getpwnam(nobody_uid)) == NULL) {
- tst_brkm(TBROK, tst_exit, "\"nobody\"user not present");
+ tst_brkm(TBROK, NULL, "\"nobody\"user not present");
}
if (seteuid(ltpuser->pw_uid) == -1) {
- tst_brkm(TBROK, tst_exit, "seteuid failed to "
+ tst_brkm(TBROK, NULL, "seteuid failed to "
"to set the effective uid to %d", ltpuser->pw_uid);
}
diff --git a/testcases/kernel/syscalls/munmap/munmap01.c b/testcases/kernel/syscalls/munmap/munmap01.c
index 258f9c9..58837f9 100644
--- a/testcases/kernel/syscalls/munmap/munmap01.c
+++ b/testcases/kernel/syscalls/munmap/munmap01.c
@@ -97,9 +97,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Check looping state if -i option given */
@@ -158,7 +164,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/munmap/munmap02.c b/testcases/kernel/syscalls/munmap/munmap02.c
index a85f84f..9165d55 100644
--- a/testcases/kernel/syscalls/munmap/munmap02.c
+++ b/testcases/kernel/syscalls/munmap/munmap02.c
@@ -101,9 +101,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Check looping state if -i option given */
@@ -156,7 +162,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/munmap/munmap03.c b/testcases/kernel/syscalls/munmap/munmap03.c
index 6199566..912a5d3 100644
--- a/testcases/kernel/syscalls/munmap/munmap03.c
+++ b/testcases/kernel/syscalls/munmap/munmap03.c
@@ -98,9 +98,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* set the expected errnos... */
@@ -148,7 +154,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/nanosleep/nanosleep01.c b/testcases/kernel/syscalls/nanosleep/nanosleep01.c
index 9178198..078d44e 100644
--- a/testcases/kernel/syscalls/nanosleep/nanosleep01.c
+++ b/testcases/kernel/syscalls/nanosleep/nanosleep01.c
@@ -93,7 +93,11 @@
int retval = 0, e_code, status;
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
diff --git a/testcases/kernel/syscalls/nanosleep/nanosleep02.c b/testcases/kernel/syscalls/nanosleep/nanosleep02.c
index 553f6a2..3aa651a 100644
--- a/testcases/kernel/syscalls/nanosleep/nanosleep02.c
+++ b/testcases/kernel/syscalls/nanosleep/nanosleep02.c
@@ -113,9 +113,15 @@
int status; /* child exit status */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child, "dddd", &timereq.tv_sec, &timereq.tv_nsec,
@@ -175,7 +181,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/nanosleep/nanosleep03.c b/testcases/kernel/syscalls/nanosleep/nanosleep03.c
index aeddd6f..c880767 100644
--- a/testcases/kernel/syscalls/nanosleep/nanosleep03.c
+++ b/testcases/kernel/syscalls/nanosleep/nanosleep03.c
@@ -92,9 +92,15 @@
int status; /* child exit status */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child, "dddd", &timereq.tv_sec, &timereq.tv_nsec,
@@ -155,7 +161,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/nanosleep/nanosleep04.c b/testcases/kernel/syscalls/nanosleep/nanosleep04.c
index 5020023..93f4474 100644
--- a/testcases/kernel/syscalls/nanosleep/nanosleep04.c
+++ b/testcases/kernel/syscalls/nanosleep/nanosleep04.c
@@ -89,9 +89,15 @@
int status; /* child exit status */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform global setup for test */
@@ -160,7 +166,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/newuname/newuname01.c b/testcases/kernel/syscalls/newuname/newuname01.c
index 15c42c0..9f1b51e 100644
--- a/testcases/kernel/syscalls/newuname/newuname01.c
+++ b/testcases/kernel/syscalls/newuname/newuname01.c
@@ -117,7 +117,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
tst_exit();
}
diff --git a/testcases/kernel/syscalls/nftw/nftw.c b/testcases/kernel/syscalls/nftw/nftw.c
index 801f5a3..5718cb1 100644
--- a/testcases/kernel/syscalls/nftw/nftw.c
+++ b/testcases/kernel/syscalls/nftw/nftw.c
@@ -663,7 +663,7 @@
cleanup_function();
anyfail(); /* THIS CALL DOES NOT RETURN - EXITS!! */
- /*NOTREACHED*/ return 0;
+ return 0;
/*--------------------------------------------------------------*/
}
diff --git a/testcases/kernel/syscalls/nftw/nftw64.c b/testcases/kernel/syscalls/nftw/nftw64.c
index 4941065..a5cf382 100644
--- a/testcases/kernel/syscalls/nftw/nftw64.c
+++ b/testcases/kernel/syscalls/nftw/nftw64.c
@@ -689,7 +689,7 @@
anyfail(); /* THIS CALL DOES NOT RETURN - EXITS!! */
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*--------------------------------------------------------------*/
diff --git a/testcases/kernel/syscalls/nice/nice01.c b/testcases/kernel/syscalls/nice/nice01.c
index 7904270..c78f0b3 100644
--- a/testcases/kernel/syscalls/nice/nice01.c
+++ b/testcases/kernel/syscalls/nice/nice01.c
@@ -95,9 +95,15 @@
int rval;
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform global setup for test */
@@ -164,7 +170,7 @@
/* Make sure the calling process is super-user only */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Must be ROOT to run this test.");
+ tst_brkm(TBROK, NULL, "Must be ROOT to run this test.");
}
/* Pause if that option was specified */
diff --git a/testcases/kernel/syscalls/nice/nice02.c b/testcases/kernel/syscalls/nice/nice02.c
index 048f0ce..844f7e4 100644
--- a/testcases/kernel/syscalls/nice/nice02.c
+++ b/testcases/kernel/syscalls/nice/nice02.c
@@ -89,9 +89,15 @@
int max_val; /* Maximum nice value per OS. */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform global setup for test */
diff --git a/testcases/kernel/syscalls/nice/nice03.c b/testcases/kernel/syscalls/nice/nice03.c
index 04a3c82..0fcd07b 100644
--- a/testcases/kernel/syscalls/nice/nice03.c
+++ b/testcases/kernel/syscalls/nice/nice03.c
@@ -92,9 +92,15 @@
int New_nice; /* priority of process after nice() */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform global setup for test */
diff --git a/testcases/kernel/syscalls/nice/nice04.c b/testcases/kernel/syscalls/nice/nice04.c
index 644789a..899bcf1 100644
--- a/testcases/kernel/syscalls/nice/nice04.c
+++ b/testcases/kernel/syscalls/nice/nice04.c
@@ -100,9 +100,15 @@
char *test_desc; /* test specific error message */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform global setup for test */
@@ -156,7 +162,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/open/open01.c b/testcases/kernel/syscalls/open/open01.c
index 2405dda..fb88616 100644
--- a/testcases/kernel/syscalls/open/open01.c
+++ b/testcases/kernel/syscalls/open/open01.c
@@ -78,8 +78,12 @@
* parse standard command line options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup(); /* global setup for test */
@@ -149,7 +153,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/open/open02.c b/testcases/kernel/syscalls/open/open02.c
index cb1efd6..7ca5b59 100644
--- a/testcases/kernel/syscalls/open/open02.c
+++ b/testcases/kernel/syscalls/open/open02.c
@@ -70,8 +70,12 @@
* parse standard command line options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup(); /* global setup for test */
@@ -101,7 +105,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/open/open03.c b/testcases/kernel/syscalls/open/open03.c
index 591ad6d..b9a290b 100644
--- a/testcases/kernel/syscalls/open/open03.c
+++ b/testcases/kernel/syscalls/open/open03.c
@@ -138,7 +138,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/open/open04.c b/testcases/kernel/syscalls/open/open04.c
index c441390..ec3b02a 100644
--- a/testcases/kernel/syscalls/open/open04.c
+++ b/testcases/kernel/syscalls/open/open04.c
@@ -75,7 +75,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -106,7 +110,7 @@
close(fd);
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -137,7 +141,7 @@
/* Allocate memory for stat and ustat structure variables */
if ((buf = (int *)malloc(sizeof(int) * nfile - first)) == NULL) {
- tst_brkm(TBROK, tst_exit, "Failed to allocate Memory");
+ tst_brkm(TBROK, NULL, "Failed to allocate Memory");
}
for (ifile = first; ifile <= nfile; ifile++) {
diff --git a/testcases/kernel/syscalls/open/open05.c b/testcases/kernel/syscalls/open/open05.c
index a1666a7..05a8948 100644
--- a/testcases/kernel/syscalls/open/open05.c
+++ b/testcases/kernel/syscalls/open/open05.c
@@ -75,7 +75,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -90,7 +94,7 @@
if ((pid = FORK_OR_VFORK()) == -1) {
tst_brkm(TBROK, cleanup, "fork() failed");
- /*NOTREACHED*/}
+ }
if (pid == 0) { /* child */
if (seteuid(nobody->pw_uid) == -1) {
@@ -137,7 +141,7 @@
}
}
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -147,7 +151,7 @@
{
/* test must be run as root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Must run test as root");
+ tst_brkm(TBROK, NULL, "Must run test as root");
}
/* capture signals */
@@ -165,7 +169,7 @@
if ((fd = open(fname, O_RDWR | O_CREAT, 0700)) == -1) {
tst_brkm(TBROK, cleanup, "open() failed, errno: %d", errno);
- /*NOTREACHED*/}
+ }
}
/*
diff --git a/testcases/kernel/syscalls/open/open06.c b/testcases/kernel/syscalls/open/open06.c
index 5a711ae..a36f8d5 100644
--- a/testcases/kernel/syscalls/open/open06.c
+++ b/testcases/kernel/syscalls/open/open06.c
@@ -70,7 +70,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -99,7 +103,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -120,7 +124,7 @@
if (mknod(fname, S_IFIFO | 0644, (dev_t) NULL) == -1) {
tst_brkm(TBROK, cleanup, "mknod FAILED");
- /*NOTREACHED*/}
+ }
}
/*
diff --git a/testcases/kernel/syscalls/open/open07.c b/testcases/kernel/syscalls/open/open07.c
index 7529ee8..378d02b 100644
--- a/testcases/kernel/syscalls/open/open07.c
+++ b/testcases/kernel/syscalls/open/open07.c
@@ -112,7 +112,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -167,7 +171,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
void setupfunc_test1()
@@ -178,10 +182,10 @@
sprintf(file2, "open03.2.%d", getpid());
if ((fd1 = creat(file1, 00700)) < 0) {
tst_brkm(TBROK, cleanup, "creat(2) failed: errno: %d", errno);
- /*NOTREACHED*/}
+ }
if (symlink(file1, file2) < 0) {
tst_brkm(TBROK, cleanup, "symlink(2) failed: errno: %d", errno);
- /*NOTREACHED*/}
+ }
strcpy(TC[0].filename, file2);
}
@@ -193,10 +197,10 @@
sprintf(file2, "open03.4.%d", getpid());
if (mkdir(file1, 00700) < 0) {
tst_brkm(TBROK, cleanup, "mkdir(2) failed: errno: %d", errno);
- /*NOTREACHED*/}
+ }
if (symlink(file1, file2) < 0) {
tst_brkm(TBROK, cleanup, "symlink(2) failed: errno: %d", errno);
- /*NOTREACHED*/}
+ }
strcpy(TC[1].filename, file2);
}
@@ -209,13 +213,13 @@
sprintf(file3, "open03.7.%d", getpid());
if ((fd2 = creat(file1, 00700)) < 0) {
tst_brkm(TBROK, cleanup, "creat(2) failed: errno: %d", errno);
- /*NOTREACHED*/}
+ }
if (symlink(file1, file2) < 0) {
tst_brkm(TBROK, cleanup, "symlink(2) failed: errno: %d", errno);
- /*NOTREACHED*/}
+ }
if (symlink(file2, file3) < 0) {
tst_brkm(TBROK, cleanup, "symlink(2) failed: errno: %d", errno);
- /*NOTREACHED*/}
+ }
strcpy(TC[2].filename, file3);
}
@@ -228,13 +232,13 @@
sprintf(file3, "open03.10.%d", getpid());
if (mkdir(file1, 00700) < 0) {
tst_brkm(TBROK, cleanup, "mkdir(2) failed: errno: %d", errno);
- /*NOTREACHED*/}
+ }
if (symlink(file1, file2) < 0) {
tst_brkm(TBROK, cleanup, "symlink(2) failed: errno: %d", errno);
- /*NOTREACHED*/}
+ }
if (symlink(file2, file3) < 0) {
tst_brkm(TBROK, cleanup, "symlink(2) failed: errno: %d", errno);
- /*NOTREACHED*/}
+ }
strcpy(TC[3].filename, file3);
}
@@ -246,10 +250,10 @@
sprintf(file2, "open12.4.%d", getpid());
if (mkdir(file1, 00700) < 0) {
tst_brkm(TBROK, cleanup, "mkdir(2) failed: errno: %d", errno);
- /*NOTREACHED*/}
+ }
if (symlink(file1, file2) < 0) {
tst_brkm(TBROK, cleanup, "symlink(2) failed: errno: %d", errno);
- /*NOTREACHED*/}
+ }
strcpy(TC[4].filename, file2);
strcat(TC[4].filename, "/");
}
diff --git a/testcases/kernel/syscalls/open/open08.c b/testcases/kernel/syscalls/open/open08.c
index 0bc2c45..4ebc854 100644
--- a/testcases/kernel/syscalls/open/open08.c
+++ b/testcases/kernel/syscalls/open/open08.c
@@ -102,7 +102,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -142,7 +146,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -162,14 +166,14 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setgid(ltpuser->pw_gid) == -1) {
- tst_brkm(TBROK | TERRNO, tst_exit, "setgid(%d) failed",
+ tst_brkm(TBROK | TERRNO, NULL, "setgid(%d) failed",
ltpuser->pw_gid);
} else if (setuid(ltpuser->pw_uid) == -1) {
- tst_brkm(TBROK | TERRNO, tst_exit, "setuid(%d) failed",
+ tst_brkm(TBROK | TERRNO, NULL, "setuid(%d) failed",
ltpuser->pw_uid);
}
diff --git a/testcases/kernel/syscalls/open/open09.c b/testcases/kernel/syscalls/open/open09.c
index 0931a2f..66f835a 100644
--- a/testcases/kernel/syscalls/open/open09.c
+++ b/testcases/kernel/syscalls/open/open09.c
@@ -65,7 +65,7 @@
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
tst_resm(TBROK, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
tst_tmpdir();
local_flag = PASSED;
sprintf(tempfile, "open09.%d", getpid());
diff --git a/testcases/kernel/syscalls/open/open10.c b/testcases/kernel/syscalls/open/open10.c
index b2eb11d..ef14f79 100644
--- a/testcases/kernel/syscalls/open/open10.c
+++ b/testcases/kernel/syscalls/open/open10.c
@@ -123,8 +123,12 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
tst_tmpdir();
diff --git a/testcases/kernel/syscalls/openat/openat01.c b/testcases/kernel/syscalls/openat/openat01.c
index 05adc9a..c74716e 100644
--- a/testcases/kernel/syscalls/openat/openat01.c
+++ b/testcases/kernel/syscalls/openat/openat01.c
@@ -98,7 +98,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/pathconf/pathconf01.c b/testcases/kernel/syscalls/pathconf/pathconf01.c
index daea9ae..9ce298a 100644
--- a/testcases/kernel/syscalls/pathconf/pathconf01.c
+++ b/testcases/kernel/syscalls/pathconf/pathconf01.c
@@ -161,7 +161,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, options, &help)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
if (!lflag) {
path = strdup("/tmp");
diff --git a/testcases/kernel/syscalls/pause/pause01.c b/testcases/kernel/syscalls/pause/pause01.c
index b5d1d1f..1693507 100644
--- a/testcases/kernel/syscalls/pause/pause01.c
+++ b/testcases/kernel/syscalls/pause/pause01.c
@@ -133,7 +133,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/pause/pause02.c b/testcases/kernel/syscalls/pause/pause02.c
index 880928e..b785b5a 100644
--- a/testcases/kernel/syscalls/pause/pause02.c
+++ b/testcases/kernel/syscalls/pause/pause02.c
@@ -95,9 +95,15 @@
int rval; /* return value for wait() */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child_uclinux, "");
diff --git a/testcases/kernel/syscalls/pause/pause03.c b/testcases/kernel/syscalls/pause/pause03.c
index a63d78b..0e90ac8 100644
--- a/testcases/kernel/syscalls/pause/pause03.c
+++ b/testcases/kernel/syscalls/pause/pause03.c
@@ -90,9 +90,15 @@
int ret_val; /* return value for wait() */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child, "");
diff --git a/testcases/kernel/syscalls/personality/personality01.c b/testcases/kernel/syscalls/personality/personality01.c
index 8c16229..07d568c 100644
--- a/testcases/kernel/syscalls/personality/personality01.c
+++ b/testcases/kernel/syscalls/personality/personality01.c
@@ -75,7 +75,6 @@
PER_IRIX32, PER_IRIXN32, PER_IRIX64
};
-#ifdef __NR_personality
int main(int ac, char **av)
{
int lc; /* loop counter */
@@ -83,9 +82,8 @@
int i, start_pers;
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
setup(); /* global setup */
@@ -145,15 +143,8 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
-}
-#else
-int main(int ac, char **av)
-{
- tst_resm(TCONF, "personality() not defined in your system");
tst_exit();
}
-#endif
/*
* setup() - performs all the ONE TIME setup for this test.
@@ -178,7 +169,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/personality/personality02.c b/testcases/kernel/syscalls/personality/personality02.c
index 0659fa8..d26efa0 100644
--- a/testcases/kernel/syscalls/personality/personality02.c
+++ b/testcases/kernel/syscalls/personality/personality02.c
@@ -66,6 +66,7 @@
#include <errno.h>
#include <linux/personality.h>
+#include "linux_syscall_numbers.h"
#undef personality
extern int personality(unsigned long);
@@ -79,7 +80,6 @@
#define PER_BAD 0x00dd /* A non-existent personality type */
-#ifdef __NR_personality
int main(int ac, char **av)
{
int lc; /* loop counter */
@@ -87,16 +87,15 @@
int start_pers;
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
setup(); /* global setup */
start_pers = personality(PER_LINUX);
if (start_pers == -1) {
printf("personality01: Test Failed\n");
- exit(-1);
+ exit(1);
}
/* The following checks the looping state if -i option given */
@@ -126,17 +125,8 @@
}
cleanup();
-
- /*NOTREACHED*/ return 0;
-}
-#else
-int main(int ac, char **av)
-{
- tst_resm(TCONF, "personality() not defined in your system");
tst_exit();
}
-#endif
-
/*
* setup() - performs all the ONE TIME setup for this test.
@@ -161,7 +151,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/pipe/pipe01.c b/testcases/kernel/syscalls/pipe/pipe01.c
index d9740d4..54562a1 100644
--- a/testcases/kernel/syscalls/pipe/pipe01.c
+++ b/testcases/kernel/syscalls/pipe/pipe01.c
@@ -78,9 +78,8 @@
int greater, length;
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
setup();
@@ -106,16 +105,16 @@
tst_brkm(TBROK, cleanup, "write() failed");
}
- if ((written < 0) || (written > 26)) {
+ if (written < 0 || written > 26) {
tst_resm(TFAIL, "Condition #1 test failed");
continue;
}
if ((red = safe_read(fildes[0], rebuf, written)) == -1) {
- tst_brkm(TBROK, cleanup, "read() failed");
+ tst_brkm(TBROK|TERRNO, cleanup, "read() failed");
}
- if ((red < 0) || (red > written)) {
+ if (red < 0 || red > written) {
tst_resm(TFAIL, "Condition #2 test failed");
continue;
}
@@ -132,7 +131,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -158,7 +157,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/pipe/pipe02.c b/testcases/kernel/syscalls/pipe/pipe02.c
index ec9600b..7e24efe 100644
--- a/testcases/kernel/syscalls/pipe/pipe02.c
+++ b/testcases/kernel/syscalls/pipe/pipe02.c
@@ -91,8 +91,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
#ifdef UCLINUX
maybe_run_child(&do_child, "dd", &pp[0], &pp[1]);
#endif
diff --git a/testcases/kernel/syscalls/pipe/pipe03.c b/testcases/kernel/syscalls/pipe/pipe03.c
index 4899653..3695bf6 100644
--- a/testcases/kernel/syscalls/pipe/pipe03.c
+++ b/testcases/kernel/syscalls/pipe/pipe03.c
@@ -76,9 +76,8 @@
char rbuf[BUFSIZ];
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
setup();
@@ -90,8 +89,8 @@
TEST(pipe(fildes));
if (TEST_RETURN == -1)
- tst_brkm(TBROK, cleanup, "pipe() failed unexpectedly "
- "- errno %d", TEST_ERRNO);
+ tst_brkm(TBROK|TTERRNO, cleanup,
+ "pipe() failed unexpectedly");
TEST(write(fildes[0], "A", 1));
if (TEST_RETURN == -1 && TEST_ERRNO == EBADF)
@@ -107,13 +106,13 @@
tst_resm(TPASS, "expected failure reading from "
"write end of pipe");
else
- tst_resm(TFAIL, "success when reading from "
+ tst_resm(TFAIL|TTERRNO, "success when reading from "
"write end of pipe ret=%ld, "
- "errno=%d", TEST_RETURN, TEST_ERRNO);
+ "errno=%d", TEST_RETURN);
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -139,7 +138,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/pipe/pipe04.c b/testcases/kernel/syscalls/pipe/pipe04.c
index 431b64a..01be958 100644
--- a/testcases/kernel/syscalls/pipe/pipe04.c
+++ b/testcases/kernel/syscalls/pipe/pipe04.c
@@ -88,9 +88,8 @@
char rbuf[BUFSIZ];
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
#ifdef UCLINUX
maybe_run_child(&c1func, "ndd", 1, &fildes[0], &fildes[1]);
maybe_run_child(&c2func, "ndd", 2, &fildes[0], &fildes[1]);
@@ -174,25 +173,24 @@
* Set action for the alarm
*/
if (signal(SIGALRM, alarmfunc) == SIG_ERR)
- tst_resm(TWARN, "call to signal failed, errno=%d",
- errno);
+ tst_resm(TWARN|TERRNO, "call to signal failed");
/*
* Set an alarm for 60 seconds just in case the child
* processes don't die
*/
alarm(60);
- if ((wtchild = waitpid(c1pid, &wtstatus, 0)) != -1) {
+ if (waitpid(c1pid, &wtstatus, 0) != -1) {
if (wtstatus != SIGKILL)
- tst_resm(TFAIL, "unexpected wait status %d, "
- "errno=%d", wtstatus, errno);
+ tst_resm(TFAIL|TERRNO, "unexpected wait status "
+ "%d", wtstatus);
else
tst_resm(TPASS, "Child 1 killed while "
"writing to a pipe");
}
- if ((wtchild = waitpid(c2pid, &wtstatus, 0)) != -1) {
- if (wtstatus != SIGKILL)
- tst_resm(TFAIL, "unexpected wait status %d, "
- "errno=%d", wtstatus, errno);
+ if (waitpid(c2pid, &wtstatus, 0) != -1) {
+ if (!WIFSIGNALED(wtstatus) || WTERMSIG != SIGKILL)
+ tst_resm(TFAIL|TERRNO, "unexpected wait status "
+ "%d", wtstatus);
else
tst_resm(TPASS, "Child 2 killed while "
"writing to a pipe");
@@ -202,7 +200,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -228,9 +226,6 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
}
void c1func()
@@ -239,8 +234,7 @@
tst_resm(TWARN, "Could not close fildes[0] - errno %d", errno);
while (1)
if (write(fildes[1], "bbbbbbbbbbbbbbbbbbbbbbbbb", 25) == -1)
- tst_resm(TBROK, "Child 1 error writing to pipe - "
- "errno %d", errno);
+ tst_resm(TBROK|TERRNO, "[child 1] pipe write failed");
}
void c2func()
@@ -249,13 +243,12 @@
tst_resm(TWARN, "Could not close fildes[0] - errno %d", errno);
while (1)
if (write(fildes[1], "AAAAAAAAAAAAAAAAAAAAAAAAA", 25) == -1)
- tst_resm(TBROK, "Child 2 error writing to pipe - "
- "errno %d", errno);
+ tst_resm(TBROK|TERRNO, "[child 2] pipe write failed");
}
void alarmfunc(int sig)
{
/* for some reason tst_brkm doesn't seem to work in a signal handler */
- tst_resm(TFAIL, "One or more children did not die within 60 seconds");
- cleanup();
+ tst_brkm(TFAIL, cleanup, "one or more children did't die in 60 second "
+ "time limit");
}
diff --git a/testcases/kernel/syscalls/pipe/pipe05.c b/testcases/kernel/syscalls/pipe/pipe05.c
index 3663e07..cf3dcdb 100644
--- a/testcases/kernel/syscalls/pipe/pipe05.c
+++ b/testcases/kernel/syscalls/pipe/pipe05.c
@@ -68,9 +68,8 @@
struct sigaction sa, osa;
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
setup();
@@ -114,7 +113,7 @@
}
cleanup();
- return 0;
+ tst_exit();
}
/*
@@ -148,7 +147,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/pipe/pipe06.c b/testcases/kernel/syscalls/pipe/pipe06.c
index 06d7cfe..4cc050e 100644
--- a/testcases/kernel/syscalls/pipe/pipe06.c
+++ b/testcases/kernel/syscalls/pipe/pipe06.c
@@ -64,9 +64,8 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
setup();
@@ -86,18 +85,14 @@
TEST_ERROR_LOG(TEST_ERRNO);
if (TEST_ERRNO != EMFILE) {
- tst_resm(TFAIL, "unexpected error - %d : %s - "
- "expected EMFILE", TEST_ERRNO,
- strerror(TEST_ERRNO));
+ tst_resm(TFAIL|TTERRNO, "pipe failed unexpectedly");
} else {
- tst_resm(TPASS, "expected failure - "
- "errno = %d : %s", TEST_ERRNO,
- strerror(TEST_ERRNO));
+ tst_resm(TPASS, "failed with EMFILE");
}
}
cleanup();
- return 0;
+ tst_exit();
}
/*
@@ -119,8 +114,8 @@
pipe_ret = pipe(pipes);
if (pipe_ret < 0) {
if (errno != EMFILE) {
- tst_brkm(TBROK, cleanup, "got unexpected "
- "error - %d", errno);
+ tst_brkm(TBROK|TTERRNO, cleanup,
+ "didn't get EMFILE");
}
break;
}
@@ -138,7 +133,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/pipe/pipe07.c b/testcases/kernel/syscalls/pipe/pipe07.c
index 2935d34..083e8ca 100644
--- a/testcases/kernel/syscalls/pipe/pipe07.c
+++ b/testcases/kernel/syscalls/pipe/pipe07.c
@@ -77,9 +77,8 @@
FILE *f; /* used for retrieving the used fds */
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
setup();
/* Get the currently used number of file descriptors */
mypid = getpid();
@@ -176,7 +175,4 @@
/* Remove temporary test directory */
rmdir(tempdir);
-
- /* exit with return code appropriate for results */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/pipe/pipe08.c b/testcases/kernel/syscalls/pipe/pipe08.c
index 24b5948..a608a3d 100644
--- a/testcases/kernel/syscalls/pipe/pipe08.c
+++ b/testcases/kernel/syscalls/pipe/pipe08.c
@@ -73,9 +73,8 @@
int close_stat; /* exit status of close(read fd) */
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
if (!STD_FUNCTIONAL_TEST) {
tst_resm(TWARN, "-f option should not be used");
@@ -111,7 +110,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -149,7 +148,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/pipe/pipe09.c b/testcases/kernel/syscalls/pipe/pipe09.c
index 7b9a962..e036bf0 100644
--- a/testcases/kernel/syscalls/pipe/pipe09.c
+++ b/testcases/kernel/syscalls/pipe/pipe09.c
@@ -85,9 +85,8 @@
int fork_1, fork_2; /* ret values in parent */
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
setup();
@@ -111,7 +110,7 @@
if ((fork_1 = FORK_OR_VFORK()) == -1) {
tst_brkm(TBROK, cleanup, "fork() #1 failed");
- /*NOTREACHED*/}
+ }
if (fork_1 == 0) { /* 1st child */
if (close(pipefd[0]) != 0) {
@@ -131,26 +130,25 @@
/* parent */
- waitpid(fork_1, &wtstatus, 0);
- if (WEXITSTATUS(wtstatus) != 0) {
- tst_brkm(TBROK, cleanup, "problem detected in child, "
- "wait status %d, errno = %d", wtstatus, errno);
+ if (waitpid(fork_1, &wtstatus, 0) == -1)
+ tst_brkm(TBROK, cleanup, "waitpid failed");
+ if (WIFEXITED(wstatus) && WEXITSTATUS(wtstatus) != 0) {
+ tst_brkm(TBROK, cleanup, "child exited abnormally");
}
if ((fork_2 = FORK_OR_VFORK()) == -1) {
tst_brkm(TBROK, cleanup, "fork() #2 failed");
- /*NOTREACHED*/}
+ }
if (fork_2 == 0) { /* 2nd child */
if (close(pipefd[0]) != 0) {
- tst_resm(TWARN, "pipefd[0] close "
- "failed, errno = %d", errno);
+ perror("pipefd[0] close failed");
exit(1);
}
for (i = 0; i < PIPEWRTCNT / 2; ++i) {
if (write(pipefd[1], "B", 1) != 1) {
- tst_resm(TWARN, "write to pipe failed");
+ perror("write to pipe failed");
exit(1);
}
}
@@ -159,16 +157,17 @@
/* parent */
- waitpid(fork_2, &wtstatus, 0);
+ if (waitpid(fork_2, &wtstatus, 0) == -1)
+ tst_brkm(TBROK, cleanup, "waitpid failed");
if (WEXITSTATUS(wtstatus) != 0) {
tst_brkm(TBROK, cleanup, "problem detected in child, "
"wait status %d, errno = %d", wtstatus, errno);
}
if (close(pipefd[1]) != 0) {
- tst_brkm(TBROK, cleanup, "pipefd[1] close failed, "
- "errno = %d", errno);
- /*NOTREACHED*/}
+ tst_brkm(TBROK|TERRNO, cleanup,
+ "pipefd[1] close failed");
+ }
while ((red = safe_read(pipefd[0], rebuf, 100)) > 0) {
for (i = 0; i < red; i++) {
@@ -187,8 +186,8 @@
}
if (red == -1) {
- tst_brkm(TBROK, cleanup, "Failure reading pipefd pipe, "
- "errno = %d", errno);
+ tst_brkm(TBROK|TERRNO, cleanup,
+ "reading pipefd pipe failed");
}
if (Bcnt == Acnt && Bcnt == (PIPEWRTCNT / 2)) {
@@ -203,7 +202,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -229,7 +228,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/pipe/pipe10.c b/testcases/kernel/syscalls/pipe/pipe10.c
index 9b92780..19a554a 100644
--- a/testcases/kernel/syscalls/pipe/pipe10.c
+++ b/testcases/kernel/syscalls/pipe/pipe10.c
@@ -81,9 +81,8 @@
int retval = 0, status, e_code;
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
setup();
@@ -119,7 +118,7 @@
if (forkstat == -1) {
tst_brkm(TBROK, cleanup, "fork() failed");
- /*NOTREACHED*/}
+ }
if (forkstat == 0) { /* child */
red = safe_read(fd[0], rebuf, written);
@@ -152,7 +151,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -178,7 +177,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/pipe/pipe11.c b/testcases/kernel/syscalls/pipe/pipe11.c
index c01b73b..8a1ded3 100644
--- a/testcases/kernel/syscalls/pipe/pipe11.c
+++ b/testcases/kernel/syscalls/pipe/pipe11.c
@@ -97,8 +97,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
#ifdef UCLINUX
maybe_run_child(&do_child_uclinux, "ddddd", &fd[0], &fd[1], &kidid,
&ncperchild, &szcharbuf);
@@ -134,7 +138,7 @@
if (fork_ret < 0) {
tst_brkm(TBROK, cleanup, "fork() failed");
- /*NOTREACHED*/}
+ }
if ((fork_ret != 0) && (fork_ret != -1) && (kidid < numchild)) {
goto refork;
@@ -145,7 +149,7 @@
if (self_exec(av[0], "ddddd", fd[0], fd[1], kidid,
ncperchild, szcharbuf) < 0) {
tst_brkm(TBROK, cleanup, "self_exec failed");
- /*NOTREACHED*/}
+ }
#else
do_child();
#endif
@@ -167,7 +171,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -199,7 +203,7 @@
{
if ((rdbuf = (char *)malloc(szcharbuf)) == (char *)0) {
tst_brkm(TBROK, cleanup, "malloc of rdbuf failed");
- /*NOTREACHED*/}
+ }
do_child();
}
@@ -233,11 +237,11 @@
if ((wrbuf = (char *)malloc(szcharbuf)) == (char *)0) {
tst_brkm(TBROK, cleanup, "malloc failed");
- /*NOTREACHED*/}
+ }
if ((rdbuf = (char *)malloc(szcharbuf)) == (char *)0) {
tst_brkm(TBROK, cleanup, "malloc of rdbuf failed");
- /*NOTREACHED*/}
+ }
/* initialize wrbuf */
j = 0;
diff --git a/testcases/kernel/syscalls/pipe2/pipe2_01.c b/testcases/kernel/syscalls/pipe2/pipe2_01.c
index 96518d6..957ec84 100644
--- a/testcases/kernel/syscalls/pipe2/pipe2_01.c
+++ b/testcases/kernel/syscalls/pipe2/pipe2_01.c
@@ -146,7 +146,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
diff --git a/testcases/kernel/syscalls/pipe2/pipe2_02.c b/testcases/kernel/syscalls/pipe2/pipe2_02.c
index 634a6b3..47a6c33 100644
--- a/testcases/kernel/syscalls/pipe2/pipe2_02.c
+++ b/testcases/kernel/syscalls/pipe2/pipe2_02.c
@@ -137,7 +137,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
diff --git a/testcases/kernel/syscalls/poll/poll01.c b/testcases/kernel/syscalls/poll/poll01.c
index 03639f5..dd5b799 100644
--- a/testcases/kernel/syscalls/poll/poll01.c
+++ b/testcases/kernel/syscalls/poll/poll01.c
@@ -95,9 +95,15 @@
int rval;
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform global setup for test */
@@ -203,7 +209,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
/*
@@ -221,7 +227,7 @@
/* Creat read/write pipe */
if (pipe(fildes) < 0) {
- tst_brkm(TBROK, tst_exit,
+ tst_brkm(TBROK, NULL,
"pipe() failed to create interprocess channel");
}
diff --git a/testcases/kernel/syscalls/ppoll/ppoll01.c b/testcases/kernel/syscalls/ppoll/ppoll01.c
index bec6551..a48ae3b 100644
--- a/testcases/kernel/syscalls/ppoll/ppoll01.c
+++ b/testcases/kernel/syscalls/ppoll/ppoll01.c
@@ -110,9 +110,6 @@
/* Remove tmp dir and all files in it */
TEST_CLEANUP;
tst_rmdir();
-
- /* Exit with appropriate return code. */
- tst_exit();
}
void sighandler(int sig); /* signals handler function for the test */
@@ -137,7 +134,7 @@
/******************************************************************************/
void setup() {
/* Capture signals if any */
- signal(SIGINT, &sighandler);
+ tst_sig(NOFORK, sighandler, cleanup);
/* Create temporary directories */
TEST_PAUSE;
@@ -349,8 +346,8 @@
* Execute system call
*/
errno = 0;
- TEST(sys_ret = syscall(__NR_ppoll, p_fds, nfds, p_ts, p_sigmask, SIGSETSIZE));
- sys_errno = errno;
+ sys_ret = syscall(__NR_ppoll, p_fds, nfds, p_ts, p_sigmask, SIGSETSIZE);
+ sys_errno = errno;
if (sys_ret <= 0 || tc->ret < 0)
goto TEST_END;
@@ -358,7 +355,7 @@
tst_resm(TINFO, "EXPECT: revents=0x%04x", tc->expect_revents);
tst_resm(TINFO, "RESULT: revents=0x%04x", fds[0].revents);
- TEST_END:
+TEST_END:
/*
* Check results
*/
@@ -378,7 +375,8 @@
}
result |= (sys_errno != tc->err) || !cmp_ok;
PRINT_RESULT_CMP(sys_ret >= 0, tc->ret, tc->err, sys_ret, sys_errno, cmp_ok);
- cleanup: if (fd >= 0) {
+cleanup:
+ if (fd >= 0) {
close(fd);
cleanup_file(fpath);
}
@@ -399,7 +397,7 @@
void sighandler(int sig) {
if (sig == SIGINT)
return;
- // NOTREACHED
+
return;
}
@@ -408,53 +406,20 @@
*/
int main(int ac, char **av) {
- int result = RESULT_OK;
int i;
- int lc; /* loop counter */
- char *msg; /* message returned from parse_opts */
-
- /* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
- tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
+ int ret;
setup();
- /* Check looping state if -i option given */
- for (lc = 0; TEST_LOOPING(lc); ++lc) {
- Tst_count = 0;
- for (testno = 0; testno < TST_TOTAL; ++testno) {
- /*
- * Execute test
- */
- for (i = 0; i < (int) (sizeof(tcase) / sizeof(tcase[0])); i++) {
- int ret;
- tst_resm(TINFO, "(case%02d) START", i);
- ret = do_test(&tcase[i]);
- tst_resm(TINFO, "(case%02d) END => %s", i, (ret == 0) ? "OK"
- : "NG");
- TEST_ERROR_LOG(TEST_ERRNO);
- result |= ret;
- }
+ ret = 0;
- /*
- * Check results
- */
- switch (result) {
- case RESULT_OK:
- tst_resm(TPASS, "ppoll01 call succeeded ");
- break;
-
- default:
- tst_resm(TFAIL | TTERRNO, "%s failed", TCID);
- RPRINTF("NG");
- cleanup();
- break;
- }
-
- }
+ for (i = 0; ret == 0 &&
+ i < (sizeof(tcase) / sizeof(tcase[0])); i++) {
+ tst_resm(TINFO, "(case%02d) START", i);
+ ret = do_test(&tcase[i]);
+ tst_resm(TINFO, "(case%02d) END => %s", i, (ret == 0) ? "OK"
+ : "NG");
}
cleanup();
- return 0;
+ tst_exit();
}
-
diff --git a/testcases/kernel/syscalls/prctl/prctl01.c b/testcases/kernel/syscalls/prctl/prctl01.c
index 8ee11d6..c4e5a44 100644
--- a/testcases/kernel/syscalls/prctl/prctl01.c
+++ b/testcases/kernel/syscalls/prctl/prctl01.c
@@ -98,9 +98,15 @@
int status, sig;
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -159,7 +165,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/prctl/prctl02.c b/testcases/kernel/syscalls/prctl/prctl02.c
index 99ba546..7ef86a2 100644
--- a/testcases/kernel/syscalls/prctl/prctl02.c
+++ b/testcases/kernel/syscalls/prctl/prctl02.c
@@ -114,9 +114,15 @@
int status;
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -175,7 +181,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/pread/pread01.c b/testcases/kernel/syscalls/pread/pread01.c
index 58c67fc..8c8c76a 100644
--- a/testcases/kernel/syscalls/pread/pread01.c
+++ b/testcases/kernel/syscalls/pread/pread01.c
@@ -106,9 +106,15 @@
int nread; /* no. of bytes read by pread() */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform global setup for test */
@@ -194,7 +200,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
/*
@@ -289,7 +295,7 @@
read_buf[count] = (char *)malloc(K1);
if ((write_buf[count] == NULL) || (read_buf[count] == NULL)) {
- tst_brkm(TBROK, tst_exit,
+ tst_brkm(TBROK, NULL,
"malloc() failed on read/write buffers");
}
memset(write_buf[count], count, K1);
diff --git a/testcases/kernel/syscalls/pread/pread02.c b/testcases/kernel/syscalls/pread/pread02.c
index 32cf9b2..00dd937 100644
--- a/testcases/kernel/syscalls/pread/pread02.c
+++ b/testcases/kernel/syscalls/pread/pread02.c
@@ -121,9 +121,15 @@
char *test_desc; /* test specific error message */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform global setup for test */
@@ -184,7 +190,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -283,7 +289,7 @@
read_buf[count] = (char *)malloc(K1);
if ((write_buf[count] == NULL) || (read_buf[count] == NULL)) {
- tst_brkm(TBROK, tst_exit,
+ tst_brkm(TBROK, NULL,
"malloc() failed on read/write buffers");
}
memset(write_buf[count], count, K1);
diff --git a/testcases/kernel/syscalls/pread/pread03.c b/testcases/kernel/syscalls/pread/pread03.c
index 626be66..9eb38de 100644
--- a/testcases/kernel/syscalls/pread/pread03.c
+++ b/testcases/kernel/syscalls/pread/pread03.c
@@ -107,9 +107,15 @@
char *test_desc; /* test specific error message */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform global setup for test */
@@ -153,7 +159,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -189,7 +195,7 @@
if (mkdir(PREAD_TEMPDIR, 0777) != 0) {
tst_resm(TFAIL, "mkdir() failed to create" " test directory");
exit(1);
- /* NOTREACHED */
+
}
/* open temporary directory used for test */
@@ -214,7 +220,7 @@
read_buf[count] = (char *)malloc(K1);
if (read_buf[count] == NULL) {
- tst_brkm(TBROK, tst_exit,
+ tst_brkm(TBROK, NULL,
"malloc() failed on read buffers");
}
}
diff --git a/testcases/kernel/syscalls/ptrace/ptrace01.c b/testcases/kernel/syscalls/ptrace/ptrace01.c
index 62e7578..e152070 100644
--- a/testcases/kernel/syscalls/ptrace/ptrace01.c
+++ b/testcases/kernel/syscalls/ptrace/ptrace01.c
@@ -121,9 +121,15 @@
struct sigaction parent_act;
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child, "d", &i);
@@ -220,7 +226,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/ptrace/ptrace02.c b/testcases/kernel/syscalls/ptrace/ptrace02.c
index 6bf4961..ad0b5cf 100644
--- a/testcases/kernel/syscalls/ptrace/ptrace02.c
+++ b/testcases/kernel/syscalls/ptrace/ptrace02.c
@@ -121,9 +121,15 @@
struct sigaction parent_act;
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&do_child, "d", &i);
@@ -221,7 +227,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/ptrace/ptrace03.c b/testcases/kernel/syscalls/ptrace/ptrace03.c
index 20d5773..ccc74a4 100644
--- a/testcases/kernel/syscalls/ptrace/ptrace03.c
+++ b/testcases/kernel/syscalls/ptrace/ptrace03.c
@@ -124,9 +124,15 @@
int status;
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -204,7 +210,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/ptrace/ptrace04.c b/testcases/kernel/syscalls/ptrace/ptrace04.c
index 2a7f61d..f0f45d0 100644
--- a/testcases/kernel/syscalls/ptrace/ptrace04.c
+++ b/testcases/kernel/syscalls/ptrace/ptrace04.c
@@ -103,7 +103,7 @@
char *msg;
if (ARRAY_SIZE(regs) == 0)
- tst_brkm(TCONF, tst_exit,
+ tst_brkm(TCONF, NULL,
"test not supported for your arch (yet)");
if ((msg = parse_opts(argc, argv, NULL, NULL)))
diff --git a/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h b/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h
index 24f4d7f..40e9f81 100644
--- a/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h
+++ b/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h
@@ -34,7 +34,7 @@
int status;
if (sig != SIGCHLD) {
die:
- tst_brkm(TBROK, tst_exit, "child signal %i: %s\n", sig, strsignal(sig));
+ tst_brkm(TBROK, NULL, "child signal %i: %s\n", sig, strsignal(sig));
kill(pid, SIGKILL);
exit(1);
}
diff --git a/testcases/kernel/syscalls/pwrite/pwrite01.c b/testcases/kernel/syscalls/pwrite/pwrite01.c
index 9d1d091..8456fb2 100644
--- a/testcases/kernel/syscalls/pwrite/pwrite01.c
+++ b/testcases/kernel/syscalls/pwrite/pwrite01.c
@@ -107,9 +107,15 @@
int nwrite; /* no. of bytes written by pwrite() */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform global setup for test */
@@ -255,7 +261,7 @@
write_buf[count] = (char *)malloc(K1);
if (write_buf[count] == NULL) {
- tst_brkm(TBROK, tst_exit, "malloc() failed ");
+ tst_brkm(TBROK, NULL, "malloc() failed ");
}
memset(write_buf[count], count, K1);
}
diff --git a/testcases/kernel/syscalls/pwrite/pwrite02.c b/testcases/kernel/syscalls/pwrite/pwrite02.c
index a312d89..b0bdafc 100644
--- a/testcases/kernel/syscalls/pwrite/pwrite02.c
+++ b/testcases/kernel/syscalls/pwrite/pwrite02.c
@@ -122,9 +122,15 @@
char *test_desc; /* test specific error message */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform global setup for test */
@@ -300,7 +306,7 @@
write_buf[count] = (char *)malloc(K1);
if (write_buf[count] == NULL) {
- tst_brkm(TBROK, tst_exit,
+ tst_brkm(TBROK, NULL,
"malloc() failed on write buffer");
}
memset(write_buf[count], count, K1);
diff --git a/testcases/kernel/syscalls/pwrite/pwrite03.c b/testcases/kernel/syscalls/pwrite/pwrite03.c
index ce6910c..a8d5218 100644
--- a/testcases/kernel/syscalls/pwrite/pwrite03.c
+++ b/testcases/kernel/syscalls/pwrite/pwrite03.c
@@ -101,9 +101,15 @@
char *test_desc; /* test specific error message */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform global setup for test */
diff --git a/testcases/kernel/syscalls/quotactl/quotactl01.c b/testcases/kernel/syscalls/quotactl/quotactl01.c
index c5692d0..a6745d0 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl01.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl01.c
@@ -150,11 +150,11 @@
/* Create temporary directories */
if (geteuid() != 0) {
- tst_brkm(TCONF, tst_exit,
+ tst_brkm(TCONF, NULL,
"You must be root in order to execute this test");
}
if ((quota_loc = malloc(FILENAME_MAX)) == NULL) {
- tst_brkm(TCONF | TERRNO, tst_exit,
+ tst_brkm(TCONF | TERRNO, NULL,
"couldn't allocate memory for the quota loc buffer");
}
diff --git a/testcases/kernel/syscalls/read/read01.c b/testcases/kernel/syscalls/read/read01.c
index a560c9f..8c32eca 100644
--- a/testcases/kernel/syscalls/read/read01.c
+++ b/testcases/kernel/syscalls/read/read01.c
@@ -149,7 +149,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/read/read02.c b/testcases/kernel/syscalls/read/read02.c
index 6c15ae0..fffd1d2 100644
--- a/testcases/kernel/syscalls/read/read02.c
+++ b/testcases/kernel/syscalls/read/read02.c
@@ -112,7 +112,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -151,7 +155,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -178,7 +182,7 @@
if (write(fd3, "A", 1) != 1) {
tst_brkm(TBROK, cleanup, "can't write to fd3");
- /*NOTREACHED*/}
+ }
close(fd3);
if ((fd3 = open(fname, O_RDWR | O_CREAT, 0666)) == -1) {
tst_brkm(TBROK, cleanup, "open of fd3 (temp file) failed");
diff --git a/testcases/kernel/syscalls/read/read03.c b/testcases/kernel/syscalls/read/read03.c
index 7b3afe8..b84991f 100644
--- a/testcases/kernel/syscalls/read/read03.c
+++ b/testcases/kernel/syscalls/read/read03.c
@@ -74,7 +74,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -108,7 +112,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -130,13 +134,13 @@
if (mknod(fifo, S_IFIFO | 0777, 0) < 0) {
tst_brkm(TBROK, cleanup, "mknod() failed, errno: %d", errno);
- /*NOTREACHED*/}
+ }
if (stat(fifo, &buf) != 0) {
tst_brkm(TBROK, cleanup, "stat() failed, errno: %d", errno);
- /*NOTREACHED*/}
+ }
if ((buf.st_mode & S_IFIFO) == 0) {
tst_brkm(TBROK, cleanup, "Mode does not indicate fifo file");
- /*NOTREACHED*/}
+ }
rfd = open(fifo, O_RDONLY | O_NONBLOCK);
wfd = open(fifo, O_WRONLY | O_NONBLOCK);
diff --git a/testcases/kernel/syscalls/read/read04.c b/testcases/kernel/syscalls/read/read04.c
index e68b2e6..69319e0 100644
--- a/testcases/kernel/syscalls/read/read04.c
+++ b/testcases/kernel/syscalls/read/read04.c
@@ -77,8 +77,12 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup(); /* global setup for test */
@@ -89,7 +93,7 @@
if ((rfild = open(fname, O_RDONLY)) == -1) {
tst_brkm(TBROK, cleanup, "can't open for reading");
- /*NOTREACHED*/}
+ }
TEST(read(rfild, prbuf, BUFSIZ));
if (TEST_RETURN == -1) {
@@ -114,10 +118,10 @@
}
if (close(rfild) == -1) {
tst_brkm(TBROK, cleanup, "close() failed");
- /*NOTREACHED*/}
+ }
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -141,10 +145,10 @@
if ((fild = creat(fname, 0777)) == -1) {
tst_brkm(TBROK, cleanup, "creat(%s, 0777) Failed, errno = %d"
" : %s", fname, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
if (write(fild, palfa, TST_SIZE) != TST_SIZE) {
tst_brkm(TBROK, cleanup, "can't write to Xread");
- /*NOTREACHED*/}
+ }
close(fild);
}
diff --git a/testcases/kernel/syscalls/readdir/readdir02.c b/testcases/kernel/syscalls/readdir/readdir02.c
index 13f48df..af4eb08 100644
--- a/testcases/kernel/syscalls/readdir/readdir02.c
+++ b/testcases/kernel/syscalls/readdir/readdir02.c
@@ -98,7 +98,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/***************************************************************
diff --git a/testcases/kernel/syscalls/readlink/readlink01.c b/testcases/kernel/syscalls/readlink/readlink01.c
index 233fb52..4ee37e4 100644
--- a/testcases/kernel/syscalls/readlink/readlink01.c
+++ b/testcases/kernel/syscalls/readlink/readlink01.c
@@ -98,18 +98,13 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
- msg = parse_opts(ac, av, NULL, NULL);
- if (msg != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
- /* Perform global setup for test */
setup();
- /* Check looping state if -i option given */
for (lc = 0; TEST_LOOPING(lc); lc++) {
- /* Reset Tst_count in case we are looping. */
Tst_count = 0;
/*
@@ -118,7 +113,6 @@
*/
TEST(readlink(SYMFILE, buffer, sizeof(buffer)));
- /* Check return code of readlink(2) */
if (TEST_RETURN == -1) {
tst_resm(TFAIL,
"readlink() on %s failed, errno=%d : %s",
@@ -155,13 +149,12 @@
} else {
tst_resm(TPASS, "call succeeded");
}
- } /* End for TEST_LOOPING */
+ }
- /* Call cleanup() to undo setup done for the test. */
cleanup();
- return 0;
-} /* End main */
+ tst_exit();
+}
/*
* setup() - performs all ONE TIME setup for this test.
@@ -174,44 +167,35 @@
{
int fd; /* file handle for testfile */
- /* Switch to nobody user for correct error code collection */
- if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
- }
+ tst_require_root(NULL);
+
if ((ltpuser = getpwnam(nobody_uid)) == NULL) {
tst_brkm(TBROK, cleanup, "getpwname(nobody_uid) failed ");
}
if (seteuid(ltpuser->pw_uid) == -1) {
- tst_resm(TINFO, "seteuid failed to "
- "to set the effective uid to %d", ltpuser->pw_uid);
- perror("seteuid");
+ tst_brkm(TBROK|TERRNO, cleanup, "seteuid to nobody failed");
}
- /* capture signals */
tst_sig(NOFORK, DEF_HANDLER, cleanup);
- /* Pause if that option was specified */
TEST_PAUSE;
- /* make a temp directory and cd to it */
tst_tmpdir();
if ((fd = open(TESTFILE, O_RDWR | O_CREAT, FILE_MODE)) == -1) {
- tst_brkm(TBROK, cleanup,
- "open(%s, O_RDWR|O_CREAT, %#o) failed, errno=%d : %s",
- TESTFILE, FILE_MODE, errno, strerror(errno));
+ tst_brkm(TBROK|TERRNO, cleanup,
+ "open(%s, O_RDWR|O_CREAT, %#o) failed",
+ TESTFILE, FILE_MODE);
}
if (close(fd) == -1) {
- tst_resm(TWARN, "close(%s) Failed, errno=%d : %s",
- TESTFILE, errno, strerror(errno));
+ tst_resm(TWARN|TERRNO, "close(%s) failed", TESTFILE);
}
/* Create a symlink of testfile under temporary directory */
if (symlink(TESTFILE, SYMFILE) < 0) {
- tst_brkm(TBROK, cleanup,
- "symlink(%s, %s) failed, errno=%d : %s",
- TESTFILE, SYMFILE, errno, strerror(errno));
+ tst_brkm(TBROK|TERRNO, cleanup, "symlink(%s, %s) failed",
+ TESTFILE, SYMFILE);
}
/* Get the strlen of testfile */
@@ -232,9 +216,6 @@
*/
TEST_CLEANUP;
- /* Remove tmp dir and all files in it */
tst_rmdir();
- /* exit with return code appropriate for results */
- tst_exit();
-}
+}
\ No newline at end of file
diff --git a/testcases/kernel/syscalls/readlink/readlink02.c b/testcases/kernel/syscalls/readlink/readlink02.c
index b5a0e0b..ddfd0ac 100644
--- a/testcases/kernel/syscalls/readlink/readlink02.c
+++ b/testcases/kernel/syscalls/readlink/readlink02.c
@@ -137,7 +137,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/readlink/readlink03.c b/testcases/kernel/syscalls/readlink/readlink03.c
index 461ab9f..ca5fbe0 100644
--- a/testcases/kernel/syscalls/readlink/readlink03.c
+++ b/testcases/kernel/syscalls/readlink/readlink03.c
@@ -150,9 +150,15 @@
size_t buf_size; /* size of buffer for readlink */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/*
@@ -226,7 +232,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
if ((ltpuser = getpwnam(nobody_uid)) == NULL) {
tst_brkm(TBROK, cleanup, "getpwname(nobody_uid) failed ");
diff --git a/testcases/kernel/syscalls/readlink/readlink04.c b/testcases/kernel/syscalls/readlink/readlink04.c
index f71d60c..24af4a9 100644
--- a/testcases/kernel/syscalls/readlink/readlink04.c
+++ b/testcases/kernel/syscalls/readlink/readlink04.c
@@ -102,9 +102,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform global setup for test */
@@ -184,7 +190,7 @@
/* Check that the test process id is super/root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Must be root for this test!");
+ tst_brkm(TBROK, NULL, "Must be root for this test!");
}
/* capture signals */
@@ -195,7 +201,7 @@
/* Get current bin directory */
if (getcwd(bin_dir, sizeof(bin_dir)) == NULL) {
- tst_brkm(TBROK, tst_exit,
+ tst_brkm(TBROK, NULL,
"getcwd(3) fails to get working directory of process");
}
@@ -204,7 +210,7 @@
/* get the name of the temporary directory */
if ((tmp_dir = getcwd(tmp_dir, 0)) == NULL) {
- tst_brkm(TBROK, tst_exit, "getcwd failed");
+ tst_brkm(TBROK, NULL, "getcwd failed");
}
if ((pwent = getpwnam("bin")) == NULL) {
diff --git a/testcases/kernel/syscalls/readlinkat/readlinkat01.c b/testcases/kernel/syscalls/readlinkat/readlinkat01.c
index cb9dce7..d6ba697 100644
--- a/testcases/kernel/syscalls/readlinkat/readlinkat01.c
+++ b/testcases/kernel/syscalls/readlinkat/readlinkat01.c
@@ -111,7 +111,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/readv/readv01.c b/testcases/kernel/syscalls/readv/readv01.c
index ea74297..2fc7ad0 100644
--- a/testcases/kernel/syscalls/readv/readv01.c
+++ b/testcases/kernel/syscalls/readv/readv01.c
@@ -92,8 +92,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup();
@@ -125,7 +129,7 @@
close(fd);
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
int init_buffs(char *pbufs[])
diff --git a/testcases/kernel/syscalls/readv/readv02.c b/testcases/kernel/syscalls/readv/readv02.c
index fd14815..db41a7e 100644
--- a/testcases/kernel/syscalls/readv/readv02.c
+++ b/testcases/kernel/syscalls/readv/readv02.c
@@ -107,8 +107,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup();
@@ -182,7 +186,7 @@
close(fd[1]);
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
diff --git a/testcases/kernel/syscalls/readv/readv03.c b/testcases/kernel/syscalls/readv/readv03.c
index 171c84d..9c0fc0f 100644
--- a/testcases/kernel/syscalls/readv/readv03.c
+++ b/testcases/kernel/syscalls/readv/readv03.c
@@ -84,8 +84,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup();
@@ -109,7 +113,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
diff --git a/testcases/kernel/syscalls/reboot/reboot01.c b/testcases/kernel/syscalls/reboot/reboot01.c
index ae1a8aa..bc7532d 100644
--- a/testcases/kernel/syscalls/reboot/reboot01.c
+++ b/testcases/kernel/syscalls/reboot/reboot01.c
@@ -95,9 +95,15 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -127,7 +133,7 @@
/*Clean up and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/* setup() - performs all ONE TIME setup for this test */
@@ -138,7 +144,7 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* Pause if that option was specified */
diff --git a/testcases/kernel/syscalls/reboot/reboot02.c b/testcases/kernel/syscalls/reboot/reboot02.c
index 503380d..5b00656 100644
--- a/testcases/kernel/syscalls/reboot/reboot02.c
+++ b/testcases/kernel/syscalls/reboot/reboot02.c
@@ -110,9 +110,15 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -166,7 +172,7 @@
/*Clean up and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /*End of main */
/*
@@ -198,7 +204,7 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* Pause if that option was specified */
diff --git a/testcases/kernel/syscalls/recv/recv01.c b/testcases/kernel/syscalls/recv/recv01.c
index 6c15744..50d3da6 100644
--- a/testcases/kernel/syscalls/recv/recv01.c
+++ b/testcases/kernel/syscalls/recv/recv01.c
@@ -115,9 +115,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
argv0 = argv[0];
@@ -156,7 +162,7 @@
}
cleanup();
- /* NOTREACHED */
+
return 0;
} /* End main */
@@ -261,7 +267,7 @@
return pid;
}
- /*NOTREACHED*/ exit(1);
+ exit(1);
}
void do_child()
diff --git a/testcases/kernel/syscalls/recvfrom/recvfrom01.c b/testcases/kernel/syscalls/recvfrom/recvfrom01.c
index ca857df..31fd1ce 100644
--- a/testcases/kernel/syscalls/recvfrom/recvfrom01.c
+++ b/testcases/kernel/syscalls/recvfrom/recvfrom01.c
@@ -135,9 +135,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
argv0 = argv[0];
@@ -287,7 +293,7 @@
return pid;
}
- /*NOTREACHED*/ exit(1);
+ exit(1);
}
void do_child()
diff --git a/testcases/kernel/syscalls/recvmsg/recvmsg01.c b/testcases/kernel/syscalls/recvmsg/recvmsg01.c
index 07abf15..62eddc5 100644
--- a/testcases/kernel/syscalls/recvmsg/recvmsg01.c
+++ b/testcases/kernel/syscalls/recvmsg/recvmsg01.c
@@ -203,10 +203,8 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
- msg = parse_opts(argc, argv, NULL, NULL);
- if (msg != NULL) {
+ if ((msg = parse_opts(argc, argv, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
#ifdef UCLINUX
argv0 = argv[0];
maybe_run_child(&do_child, "dd", &sfd, &ufd);
@@ -430,7 +428,7 @@
(void)close(ufd);
return pid;
}
- /*NOTREACHED*/ exit(1);
+ exit(1);
}
void do_child()
diff --git a/testcases/kernel/syscalls/remap_file_pages/remap_file_pages01.c b/testcases/kernel/syscalls/remap_file_pages/remap_file_pages01.c
index 94fe8da..83d2a33 100644
--- a/testcases/kernel/syscalls/remap_file_pages/remap_file_pages01.c
+++ b/testcases/kernel/syscalls/remap_file_pages/remap_file_pages01.c
@@ -127,7 +127,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -149,7 +153,7 @@
/* clean up and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/* test case function, that runs remap_file_pages */
diff --git a/testcases/kernel/syscalls/remap_file_pages/remap_file_pages02.c b/testcases/kernel/syscalls/remap_file_pages/remap_file_pages02.c
index 9dcb611..8701b61 100644
--- a/testcases/kernel/syscalls/remap_file_pages/remap_file_pages02.c
+++ b/testcases/kernel/syscalls/remap_file_pages/remap_file_pages02.c
@@ -146,9 +146,15 @@
#endif
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -207,7 +213,7 @@
/* clean up and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
diff --git a/testcases/kernel/syscalls/rename/rename01.c b/testcases/kernel/syscalls/rename/rename01.c
index 4414406..2bdf7c6 100644
--- a/testcases/kernel/syscalls/rename/rename01.c
+++ b/testcases/kernel/syscalls/rename/rename01.c
@@ -112,9 +112,8 @@
/*
* parse standard options
*/
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/*
* perform global setup for test
@@ -143,7 +142,7 @@
if (stat(TC[i].name2, &buf1) == -1) {
tst_brkm(TBROK, cleanup, "stat of %s "
"failed", TC[i].desc);
- /* NOTREACHED */
+
}
/*
@@ -184,11 +183,8 @@
}
} /* End for TEST_LOOPING */
- /*
- * cleanup and exit
- */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
@@ -217,7 +213,7 @@
if (stat(fname, &buf1) == -1) {
tst_brkm(TBROK, cleanup, "failed to stat file %s"
"in setup()", fname);
- /* NOTREACHED */
+
}
f_olddev = buf1.st_dev;
@@ -226,12 +222,12 @@
/* create "old" directory */
if (mkdir(fdir, 00770) == -1) {
tst_brkm(TBROK, cleanup, "Could not create directory %s", fdir);
- /*NOTREACHED*/}
+ }
if (stat(fdir, &buf1) == -1) {
tst_brkm(TBROK, cleanup, "failed to stat directory %s"
"in setup()", fname);
- /* NOTREACHED */
+
}
d_olddev = buf1.st_dev;
@@ -254,9 +250,4 @@
* Remove the temporary directory.
*/
tst_rmdir();
-
- /*
- * Exit with return code appropriate for results.
- */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/rename/rename02.c b/testcases/kernel/syscalls/rename/rename02.c
index 2c5046e..b3884f3 100644
--- a/testcases/kernel/syscalls/rename/rename02.c
+++ b/testcases/kernel/syscalls/rename/rename02.c
@@ -134,23 +134,14 @@
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
- /***************************************************************
- * parse standard options
- ***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /***************************************************************
- * perform global setup for test
- ***************************************************************/
setup();
/* set the expected errnos... */
TEST_EXP_ENOS(exp_enos);
- /***************************************************************
- * check looping state if -c option given
- ***************************************************************/
for (lc = 0; TEST_LOOPING(lc); lc++) {
/* reset Tst_count in case we are looping. */
@@ -168,9 +159,6 @@
fname, mname, TEST_ERRNO,
strerror(TEST_ERRNO));
} else {
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
if (STD_FUNCTIONAL_TEST) {
/* No Verification test, yet... */
tst_resm(TPASS, "rename(%s, %s) returned %ld",
@@ -185,12 +173,9 @@
}
} /* End for TEST_LOOPING */
- /***************************************************************
- * cleanup and exit
- ***************************************************************/
cleanup();
+ tst_exit();
- return 0;
} /* End main */
/***************************************************************
@@ -227,8 +212,4 @@
/* Remove tmp dir and all files in it */
tst_rmdir();
-
- /* exit with return code appropriate for results */
- tst_exit();
-
} /* End cleanup() */
diff --git a/testcases/kernel/syscalls/rename/rename03.c b/testcases/kernel/syscalls/rename/rename03.c
index d4a201e..a274e0c 100644
--- a/testcases/kernel/syscalls/rename/rename03.c
+++ b/testcases/kernel/syscalls/rename/rename03.c
@@ -93,12 +93,8 @@
dev_t *olddev;
ino_t *oldino;
} TC[] = {
- /* comment goes here */
- {
- fname, mname, "file", &f_olddev, &f_oldino},
- /* comment goes here */
- {
- fdir, mdir, "directory", &d_olddev, &d_oldino}
+ { fname, mname, "file", &f_olddev, &f_oldino},
+ { fdir, mdir, "directory", &d_olddev, &d_oldino}
};
int main(int ac, char **av)
@@ -110,10 +106,8 @@
/*
* parse standard options
*/
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
-
/*
* perform global setup for test
*/
@@ -145,7 +139,7 @@
if (stat(TC[i].name2, &buf2) == -1) {
tst_brkm(TBROK, cleanup, "stat of %s "
"failed", TC[i].desc);
- /* NOTREACHED */
+
}
/*
@@ -186,16 +180,13 @@
/* remove the new directory */
if (rmdir(mdir) == -1) {
- tst_brkm(TBROK, cleanup, "Could not remove "
- "directory %s", mdir);
- /*NOTREACHED*/}
+ tst_brkm(TBROK, cleanup, "Couldn't remove directory %s",
+ mdir);
+ }
} /* End for TEST_LOOPING */
- /*
- * cleanup and exit
- */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
@@ -230,7 +221,7 @@
if (stat(fname, &buf1) == -1) {
tst_brkm(TBROK, cleanup, "failed to stat file %s"
"in rename()", fname);
- /* NOTREACHED */
+
}
/* save original file's dev and ino */
@@ -243,11 +234,11 @@
/* create "old" directory */
if (mkdir(fdir, 00770) == -1) {
tst_brkm(TBROK, cleanup, "Could not create directory %s", fdir);
- /*NOTREACHED*/}
+ }
if (stat(fdir, &buf1) == -1) {
tst_brkm(TBROK, cleanup, "failed to stat directory %s"
"in rename()", fdir);
- /* NOTREACHED */
+
}
d_olddev = buf1.st_dev;
@@ -256,7 +247,7 @@
/* create another directory */
if (mkdir(mdir, 00770) == -1) {
tst_brkm(TBROK, cleanup, "Could not create directory %s", mdir);
- /*NOTREACHED*/}
+ }
}
/*
@@ -275,9 +266,4 @@
* Remove the temporary directory.
*/
tst_rmdir();
-
- /*
- * Exit with return code appropriate for results.
- */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/rename/rename04.c b/testcases/kernel/syscalls/rename/rename04.c
index 2f074b3..117e203 100644
--- a/testcases/kernel/syscalls/rename/rename04.c
+++ b/testcases/kernel/syscalls/rename/rename04.c
@@ -91,9 +91,8 @@
/*
* parse standard options
*/
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/*
* perform global setup for test
@@ -139,7 +138,7 @@
* cleanup and exit
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
@@ -164,12 +163,12 @@
/* create "old" directory */
if (mkdir(fdir, 00770) == -1) {
tst_brkm(TBROK, cleanup, "Could not create directory %s", fdir);
- /*NOTREACHED*/}
+ }
if (stat(fdir, &buf1) == -1) {
tst_brkm(TBROK, cleanup, "failed to stat directory %s"
"in rename()", fdir);
- /* NOTREACHED */
+
}
/* save "old"'s dev and ino */
@@ -179,7 +178,7 @@
/* create another directory */
if (mkdir(mdir, 00770) == -1) {
tst_brkm(TBROK, cleanup, "Could not create directory %s", mdir);
- /*NOTREACHED*/}
+ }
/* create a file under "new" directory */
do_file_setup(tstfile);
@@ -187,7 +186,7 @@
if (stat(mdir, &buf2) == -1) {
tst_brkm(TBROK, cleanup, "failed to stat directory %s "
"in rename()", mdir);
- /* NOTREACHED */
+
}
/* save "new"'s dev and ino */
@@ -211,9 +210,4 @@
* Remove the temporary directory.
*/
tst_rmdir();
-
- /*
- * Exit with return code appropriate for results.
- */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/rename/rename05.c b/testcases/kernel/syscalls/rename/rename05.c
index c715202..91fe146 100644
--- a/testcases/kernel/syscalls/rename/rename05.c
+++ b/testcases/kernel/syscalls/rename/rename05.c
@@ -88,9 +88,8 @@
/*
* parse standard options
*/
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/*
* perform global setup for test
@@ -131,7 +130,7 @@
* cleanup and exit
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
@@ -157,7 +156,7 @@
if (stat(fname, &buf1) == -1) {
tst_brkm(TBROK, cleanup, "failed to stat file %s"
"in rename()", fname);
- /* NOTREACHED */
+
}
/* save "old"'s dev and ino */
@@ -167,16 +166,16 @@
/* create another directory */
if (stat(mdir, &buf2) != -1) {
tst_brkm(TBROK, cleanup, "tmp directory %s found!", mdir);
- /*NOTREACHED*/}
+ }
if (mkdir(mdir, 00770) == -1) {
tst_brkm(TBROK, cleanup, "Could not create directory %s", mdir);
- /*NOTREACHED*/}
+ }
if (stat(mdir, &buf2) == -1) {
tst_brkm(TBROK, cleanup, "failed to stat directory %s "
"in rename()", mdir);
- /* NOTREACHED */
+
}
/* save "new"'s dev and ino */
diff --git a/testcases/kernel/syscalls/rename/rename06.c b/testcases/kernel/syscalls/rename/rename06.c
index 1a1309f..61d9cf7 100644
--- a/testcases/kernel/syscalls/rename/rename06.c
+++ b/testcases/kernel/syscalls/rename/rename06.c
@@ -89,9 +89,8 @@
/*
* parse standard options
*/
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/*
* perform global setup for test
@@ -128,11 +127,9 @@
}
} /* End for TEST_LOOPING */
- /*
- * cleanup and exit
- */
cleanup();
- /*NOTREACHED*/ return 0;
+
+ tst_exit();
} /* End main */
@@ -156,14 +153,14 @@
/* create "old" directory */
if (stat(fdir, &buf1) != -1) {
tst_brkm(TBROK, cleanup, "tmp directory %s found!", fdir);
- /*NOTREACHED*/}
+ }
if (mkdir(fdir, 00770) == -1) {
tst_brkm(TBROK, cleanup, "Could not create directory %s", fdir);
- /*NOTREACHED*/}
+ }
if (stat(fdir, &buf1) == -1) {
tst_brkm(TBROK, cleanup, "failed to stat directory %s "
"in rename()", fdir);
- /* NOTREACHED */
+
}
/* save "old"'s dev and ino */
olddev = buf1.st_dev;
@@ -172,15 +169,15 @@
/* create another directory */
if (stat(mdir, &buf2) != -1) {
tst_brkm(TBROK, cleanup, "tmp directory %s found!", mdir);
- /*NOTREACHED*/}
+ }
if (mkdir(mdir, 00770) == -1) {
tst_brkm(TBROK, cleanup, "Could not create directory %s", mdir);
- /*NOTREACHED*/}
+ }
if (stat(mdir, &buf2) == -1) {
tst_brkm(TBROK, cleanup, "failed to stat directory %s "
"in rename()", mdir);
- /* NOTREACHED */
+
}
/* save "new"'s dev and ino */
@@ -204,9 +201,4 @@
* Remove the temporary directory.
*/
tst_rmdir();
-
- /*
- * Exit with return code appropriate for results.
- */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/rename/rename07.c b/testcases/kernel/syscalls/rename/rename07.c
index 14bf6da..05312b5 100644
--- a/testcases/kernel/syscalls/rename/rename07.c
+++ b/testcases/kernel/syscalls/rename/rename07.c
@@ -71,9 +71,8 @@
/*
* parse standard options
*/
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/*
* perform global setup for test
@@ -110,11 +109,8 @@
}
} /* End for TEST_LOOPING */
- /*
- * cleanup and exit
- */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
@@ -138,16 +134,16 @@
/* create "old" directory */
if (stat(fdir, &buf1) != -1) {
tst_brkm(TBROK, cleanup, "tmp directory %s found!", fdir);
- /*NOTREACHED*/}
+ }
if (mkdir(fdir, 00770) == -1) {
tst_brkm(TBROK, cleanup, "Could not create directory %s", fdir);
- /*NOTREACHED*/}
+ }
if (stat(fdir, &buf1) == -1) {
tst_brkm(TBROK, cleanup, "failed to stat directory %s "
"in rename()", fdir);
- /* NOTREACHED */
+
}
/* save "old"'s dev and ino */
@@ -162,7 +158,7 @@
if (stat(mname, &buf2) == -1) {
tst_brkm(TBROK, cleanup, "failed to stat file %s in rename()",
mname);
- /* NOTREACHED */
+
}
/* save "new"'s dev and ino */
@@ -186,9 +182,4 @@
* Remove the temporary directory.
*/
tst_rmdir();
-
- /*
- * Exit with return code appropriate for results.
- */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/rename/rename08.c b/testcases/kernel/syscalls/rename/rename08.c
index c85a1af..53e793a 100644
--- a/testcases/kernel/syscalls/rename/rename08.c
+++ b/testcases/kernel/syscalls/rename/rename08.c
@@ -115,13 +115,9 @@
/*
* parse standard options
*/
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
- /*
- * perform global setup for test
- */
setup();
/* set the expected errnos... */
@@ -159,11 +155,8 @@
}
} /* End for TEST_LOOPING */
- /*
- * cleanup and exit
- */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
@@ -212,9 +205,4 @@
* Remove the temporary directory.
*/
tst_rmdir();
-
- /*
- * Exit with return code appropriate for results.
- */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/rename/rename09.c b/testcases/kernel/syscalls/rename/rename09.c
index 271ca80..89de1a7 100644
--- a/testcases/kernel/syscalls/rename/rename09.c
+++ b/testcases/kernel/syscalls/rename/rename09.c
@@ -112,9 +112,8 @@
/*
* parse standard options
*/
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/*
* perform global setup for test
@@ -134,7 +133,7 @@
if ((pid = FORK_OR_VFORK()) == -1) {
tst_brkm(TBROK, cleanup, "fork() #1 failed");
- /*NOTREACHED*/}
+ }
if (pid == 0) { /* first child */
/* set to nobody */
@@ -146,14 +145,14 @@
nobody->pw_uid, nobody->pw_uid);
perror("setreuid");
exit(1);
- /*NOTREACHED*/}
+ }
/* create the a directory with 0700 permits */
if (mkdir(fdir, PERMS) == -1) {
tst_resm(TWARN, "mkdir(%s, %#o) Failed",
fdir, PERMS);
exit(1);
- /*NOTREACHED*/}
+ }
/* create "old" file under it */
do_file_setup(fname);
@@ -170,7 +169,7 @@
if ((pid1 = FORK_OR_VFORK()) == -1) {
tst_brkm(TBROK, cleanup, "fork() #2 failed");
- /*NOTREACHED*/}
+ }
if (pid1 == 0) { /* second child */
/* set to bin */
@@ -178,14 +177,14 @@
tst_resm(TWARN, "seteuid() failed");
perror("setreuid");
exit(1);
- /*NOTREACHED*/}
+ }
/* create "new" directory */
if (mkdir(mdir, PERMS) == -1) {
tst_resm(TWARN, "mkdir(%s, %#o) failed",
mdir, PERMS);
exit(1);
- /*NOTREACHED*/}
+ }
/* create the new file */
do_file_setup(mname);
@@ -202,7 +201,7 @@
if (TEST_ERRNO != EACCES) {
tst_resm(TFAIL, "Expected EACCES got %d",
TEST_ERRNO);
- /*NOTREACHED*/} else {
+ } else {
tst_resm(TPASS, "rename() returned EACCES");
}
@@ -241,7 +240,7 @@
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
@@ -252,8 +251,8 @@
{
/* must run as root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Must run test as root");
- /*NOTREACHED*/}
+ tst_brkm(TBROK, NULL, "Must run test as root");
+ }
/* capture signals */
tst_sig(FORK, DEF_HANDLER, cleanup);
diff --git a/testcases/kernel/syscalls/rename/rename10.c b/testcases/kernel/syscalls/rename/rename10.c
index 09690ee..7db9e66 100644
--- a/testcases/kernel/syscalls/rename/rename10.c
+++ b/testcases/kernel/syscalls/rename/rename10.c
@@ -106,9 +106,8 @@
/*
* parse standard options
*/
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/*
* perform global setup for test
@@ -150,12 +149,8 @@
}
} /* End for TEST_LOOPING */
- /*
- * cleanup and exit
- */
cleanup();
-
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
@@ -196,9 +191,4 @@
* Remove the temporary directory.
*/
tst_rmdir();
-
- /*
- * Exit with return code appropriate for results.
- */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/rename/rename12.c b/testcases/kernel/syscalls/rename/rename12.c
index 88ef774..a8e4ef9 100644
--- a/testcases/kernel/syscalls/rename/rename12.c
+++ b/testcases/kernel/syscalls/rename/rename12.c
@@ -106,9 +106,8 @@
/*
* parse standard options
*/
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/*
* perform global setup for test
@@ -134,7 +133,7 @@
if ((pid = FORK_OR_VFORK()) == -1) {
tst_brkm(TBROK, cleanup, "fork() failed");
- /*NOTREACHED*/}
+ }
if (pid == 0) { /* child */
/* set to nobody */
@@ -142,7 +141,7 @@
tst_resm(TWARN, "setreuid failed");
perror("setreuid");
exit(1);
- /*NOTREACHED*/}
+ }
/* rename "old" to "new" */
TEST(rename(fname, mname));
@@ -150,7 +149,7 @@
if (TEST_RETURN != -1) {
tst_resm(TFAIL, "call succeeded unexpectedly");
exit(1);
- /*NOTREACHED*/}
+ }
TEST_ERROR_LOG(TEST_ERRNO);
@@ -159,7 +158,7 @@
"Expected EPERM or EACCES, got %d",
TEST_ERRNO);
exit(1);
- /*NOTREACHED*/} else {
+ } else {
tst_resm(TPASS,
"rename returned EPERM or EACCES");
}
@@ -179,12 +178,8 @@
}
} /* End for TEST_LOOPING */
- /*
- * cleanup and exit
- */
cleanup();
-
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
@@ -195,8 +190,8 @@
{
/* must run as root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Must run this as root");
- /*NOTREACHED*/}
+ tst_brkm(TBROK, NULL, "Must run this as root");
+ }
/* capture signals */
tst_sig(FORK, DEF_HANDLER, cleanup);
@@ -216,17 +211,17 @@
/* create a directory */
if (mkdir(fdir, PERMS) == -1) {
tst_brkm(TBROK, cleanup, "Could not create directory %s", fdir);
- /*NOTREACHED*/}
+ }
if (stat(fdir, &buf1) == -1) {
tst_brkm(TBROK, cleanup, "failed to stat directory %s", fdir);
- /* NOTREACHED */
+
}
/* set the sticky bit */
if (chmod(fdir, buf1.st_mode | S_ISVTX) != 0) {
tst_brkm(TBROK, cleanup, "failed to set the S_ISVTX bit");
- /* NOTREACHED */
+
}
/* create a file under fdir */
@@ -252,9 +247,4 @@
* Remove the temporary directory.
*/
tst_rmdir();
-
- /*
- * Exit with return code appropriate for results.
- */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/rename/rename13.c b/testcases/kernel/syscalls/rename/rename13.c
index 32a19e9..c21358a 100644
--- a/testcases/kernel/syscalls/rename/rename13.c
+++ b/testcases/kernel/syscalls/rename/rename13.c
@@ -89,9 +89,8 @@
/*
* parse standard options
*/
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/*
* perform global setup for test
@@ -124,14 +123,14 @@
if (stat(mname, &buf2) == -1) {
tst_brkm(TBROK, cleanup, "failed to stat file "
"%s in rename()", mname);
- /* NOTREACHED */
+
}
/* check the existence of "old", and get the status */
if (stat(fname, &buf1) == -1) {
tst_brkm(TBROK, cleanup, "failed to stat file "
"%s in rename()", fname);
- /* NOTREACHED */
+
}
/* verify the new file is the same as the original */
@@ -161,7 +160,7 @@
* cleanup and exit
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -188,7 +187,7 @@
if (stat(fname, &buf1) == -1) {
tst_brkm(TBROK, cleanup, "failed to stat file %s"
"in rename()", fname);
- /* NOTREACHED */
+
}
/* save the dev and inode */
@@ -199,7 +198,7 @@
if (link(fname, mname) == -1) {
tst_brkm(TBROK, cleanup,
"link from %s to %s failed!", fname, mname);
- /*NOTREACHED*/}
+ }
}
/*
@@ -219,8 +218,4 @@
*/
tst_rmdir();
- /*
- * Exit with return code appropriate for results.
- */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/rename/rename14.c b/testcases/kernel/syscalls/rename/rename14.c
index 1b4f4df..dec6d6a 100644
--- a/testcases/kernel/syscalls/rename/rename14.c
+++ b/testcases/kernel/syscalls/rename/rename14.c
@@ -78,10 +78,8 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
- msg = parse_opts(argc, argv, NULL, NULL);
- if (msg != NULL) {
+ if ((msg = parse_opts(argc, argv, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
maybe_run_child(&dochild1, "n", 1);
maybe_run_child(&dochild2, "n", 2);
@@ -158,10 +156,7 @@
: tst_resm(TFAIL, "Test Failed");
tst_rmdir();
-/*--------------------------------------------------------------*/
- tst_exit(); /* THIS CALL DOES NOT RETURN - EXITS!! */
-/*--------------------------------------------------------------*/
- return 0;
+ tst_exit();
}
/* FUNCTIONS GO HERE */
diff --git a/testcases/kernel/syscalls/renameat/renameat01.c b/testcases/kernel/syscalls/renameat/renameat01.c
index c18dca4..f149b13 100644
--- a/testcases/kernel/syscalls/renameat/renameat01.c
+++ b/testcases/kernel/syscalls/renameat/renameat01.c
@@ -109,7 +109,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/rmdir/rmdir01.c b/testcases/kernel/syscalls/rmdir/rmdir01.c
index 3a43c62..ef2dd98 100644
--- a/testcases/kernel/syscalls/rmdir/rmdir01.c
+++ b/testcases/kernel/syscalls/rmdir/rmdir01.c
@@ -86,7 +86,11 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/*
@@ -112,7 +116,7 @@
if (mkdir(tstdir, PERMS) == -1) {
tst_brkm(TBROK, cleanup, "mkdir(%s, %#o) Failed",
tstdir, PERMS);
- /*NOTREACHED*/}
+ }
/* call rmdir using TEST macro */
TEST(rmdir(tstdir));
@@ -142,7 +146,7 @@
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
diff --git a/testcases/kernel/syscalls/rmdir/rmdir02.c b/testcases/kernel/syscalls/rmdir/rmdir02.c
index 078906b..1d01ee2 100644
--- a/testcases/kernel/syscalls/rmdir/rmdir02.c
+++ b/testcases/kernel/syscalls/rmdir/rmdir02.c
@@ -146,7 +146,11 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/*
@@ -210,7 +214,7 @@
* cleanup and exit
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
@@ -230,7 +234,7 @@
if (mkdir(tstdir1, PERMS) == -1) {
tst_brkm(TBROK, cleanup, "mkdir(%s, %#o) Failed",
tstdir1, PERMS);
- /*NOTREACHED*/}
+ }
/* create a file under tstdir1 */
do_file_setup(tstfile);
@@ -251,7 +255,7 @@
/* create a file */
if ((fd = creat(tstfile, PERMS)) == -1) {
tst_brkm(TBROK, cleanup, "creat() failed");
- /*NOTREACHED*/}
+ }
close(fd);
break;
default:
diff --git a/testcases/kernel/syscalls/rmdir/rmdir03.c b/testcases/kernel/syscalls/rmdir/rmdir03.c
index f852688..1632b78 100644
--- a/testcases/kernel/syscalls/rmdir/rmdir03.c
+++ b/testcases/kernel/syscalls/rmdir/rmdir03.c
@@ -107,7 +107,11 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
maybe_run_child(&dochild1, "ns", 1, tstdir2);
@@ -140,24 +144,24 @@
if (stat(tstdir1, &buf1) != -1) {
tst_brkm(TBROK, cleanup,
"tmp directory %s found!", tstdir1);
- /*NOTREACHED*/}
+ }
/* create a directory */
if (mkdir(tstdir1, PERMS) == -1) {
tst_brkm(TBROK, cleanup,
"Couldnot create directory %s", tstdir1);
- /*NOTREACHED*/}
+ }
if (stat(tstdir1, &buf1) == -1) {
perror("stat");
tst_brkm(TBROK, cleanup, "failed to stat directory %s "
"in rmdir()", tstdir1);
- /* NOTREACHED */
+
}
/* set the sticky bit */
if (chmod(tstdir1, buf1.st_mode | S_ISVTX) != 0) {
perror("chmod");
tst_brkm(TBROK, cleanup,
"failed to set the S_ISVTX bit");
- /* NOTREACHED */
+
}
/* create a sub directory under tstdir1 */
if (mkdir(tstdir2, PERMS) == -1) {
@@ -167,7 +171,7 @@
if ((pid = FORK_OR_VFORK()) == -1) {
tst_brkm(TBROK, cleanup, "fork() failed");
- /*NOTREACHED*/}
+ }
if (pid == 0) { /* first child */
#ifdef UCLINUX
@@ -185,16 +189,16 @@
if (mkdir(tstdir3, 0700) == -1) {
tst_brkm(TBROK, cleanup, "mkdir(%s, %#o) Failed",
tstdir3, PERMS);
- /*NOTREACHED*/}
+ }
/* create the a directory with 0700 permits */
if (mkdir(tstdir4, 0777) == -1) {
tst_brkm(TBROK, cleanup, "mkdir(%s, %#o) Failed",
tstdir4, PERMS);
- /*NOTREACHED*/}
+ }
if ((pid = FORK_OR_VFORK()) == -1) {
tst_brkm(TBROK, cleanup, "fork() failed");
- /*NOTREACHED*/}
+ }
if (pid == 0) { /* child */
#ifdef UCLINUX
@@ -236,7 +240,7 @@
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -253,7 +257,7 @@
retval = 1;
tst_brkm(TBROK, cleanup, "setreuid failed to "
"set effective uid to %d", nobody->pw_uid);
- /*NOTREACHED*/}
+ }
/* rmdir tstdir2 */
TEST(rmdir(tstdir2));
@@ -293,7 +297,7 @@
retval = 1;
tst_brkm(TBROK, cleanup, "setreuid failed to "
"set effective uid to %d", nobody->pw_uid);
- /*NOTREACHED*/}
+ }
/* rmdir tstdir4 */
TEST(rmdir(tstdir4));
@@ -326,7 +330,7 @@
{
/* test must be run as root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "test must be run as root");
+ tst_brkm(TBROK, NULL, "test must be run as root");
}
/* capture signals */
diff --git a/testcases/kernel/syscalls/rmdir/rmdir04.c b/testcases/kernel/syscalls/rmdir/rmdir04.c
index 715807c..a65ba22 100644
--- a/testcases/kernel/syscalls/rmdir/rmdir04.c
+++ b/testcases/kernel/syscalls/rmdir/rmdir04.c
@@ -140,7 +140,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
index 4e4e2fb..0cb8e12 100644
--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
@@ -155,7 +155,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
index 88e6a54..25feb25 100644
--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
@@ -151,7 +151,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
tst_exit();
}
diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
index 6ae60f6..b243e79 100644
--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
@@ -165,7 +165,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
tst_exit();
}
diff --git a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
index f0c0d6b..cffa307 100644
--- a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
+++ b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
@@ -152,7 +152,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -239,7 +243,7 @@
}
cleanup();
- /* NOTREACHED */
+
return 1;
}
diff --git a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c
index c98a18c..36d239d 100644
--- a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c
+++ b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c
@@ -156,7 +156,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
tst_exit();
}
diff --git a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
index be87f99..11780f7 100644
--- a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
+++ b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
@@ -122,7 +122,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -186,7 +190,7 @@
}
cleanup();
- /* NOTREACHED */
+
return 1;
}
diff --git a/testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max01.c b/testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max01.c
index 8fdef0f..7d0b43e 100644
--- a/testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max01.c
+++ b/testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max01.c
@@ -94,9 +94,15 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -128,7 +134,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max02.c b/testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max02.c
index 5fa86b8..46f3d6e 100644
--- a/testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max02.c
+++ b/testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max02.c
@@ -86,9 +86,15 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -117,7 +123,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/sched_get_priority_min/sched_get_priority_min01.c b/testcases/kernel/syscalls/sched_get_priority_min/sched_get_priority_min01.c
index d2a96b1..1aea113 100644
--- a/testcases/kernel/syscalls/sched_get_priority_min/sched_get_priority_min01.c
+++ b/testcases/kernel/syscalls/sched_get_priority_min/sched_get_priority_min01.c
@@ -94,9 +94,15 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -128,7 +134,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/sched_get_priority_min/sched_get_priority_min02.c b/testcases/kernel/syscalls/sched_get_priority_min/sched_get_priority_min02.c
index b8d72c6..4da3dc1 100644
--- a/testcases/kernel/syscalls/sched_get_priority_min/sched_get_priority_min02.c
+++ b/testcases/kernel/syscalls/sched_get_priority_min/sched_get_priority_min02.c
@@ -86,9 +86,15 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -117,7 +123,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c
index ec54d02..795d5d7 100644
--- a/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c
+++ b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c
@@ -134,7 +134,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -240,7 +244,7 @@
}
cleanup();
- /* NOTREACHED */
+
return (1);
}
diff --git a/testcases/kernel/syscalls/sched_getparam/sched_getparam01.c b/testcases/kernel/syscalls/sched_getparam/sched_getparam01.c
index 770e245..d223151 100644
--- a/testcases/kernel/syscalls/sched_getparam/sched_getparam01.c
+++ b/testcases/kernel/syscalls/sched_getparam/sched_getparam01.c
@@ -83,10 +83,8 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL))
- != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/* perform global setup for test */
setup();
@@ -123,10 +121,8 @@
}
} /* End for TEST_LOOPING */
- /* cleanup and exit */
cleanup();
-
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -154,7 +150,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
} /* End cleanup() */
diff --git a/testcases/kernel/syscalls/sched_getparam/sched_getparam02.c b/testcases/kernel/syscalls/sched_getparam/sched_getparam02.c
index 0c74700..5a87c70 100644
--- a/testcases/kernel/syscalls/sched_getparam/sched_getparam02.c
+++ b/testcases/kernel/syscalls/sched_getparam/sched_getparam02.c
@@ -95,10 +95,8 @@
pid_t child_pid;
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL))
- != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/* perform global setup for test */
setup();
@@ -160,11 +158,9 @@
} /* End for TEST_LOOPING */
- /* cleanup and exit */
cleanup();
-
- /*NOTREACHED*/ return 0;
-
+ tst_exit();
+
} /* End main */
/* setup() - performs all ONE TIME setup for this test */
@@ -190,7 +186,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
} /* End cleanup() */
diff --git a/testcases/kernel/syscalls/sched_getparam/sched_getparam03.c b/testcases/kernel/syscalls/sched_getparam/sched_getparam03.c
index d4ff931..6728da9 100644
--- a/testcases/kernel/syscalls/sched_getparam/sched_getparam03.c
+++ b/testcases/kernel/syscalls/sched_getparam/sched_getparam03.c
@@ -109,10 +109,8 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL))
- != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
setup(); /* global setup */
@@ -146,8 +144,8 @@
}
cleanup();
+ tst_exit();
- /*NOTREACHED*/ return 0;
}
/*
@@ -179,7 +177,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/sched_getscheduler/sched_getscheduler01.c b/testcases/kernel/syscalls/sched_getscheduler/sched_getscheduler01.c
index 08f2dab..6eac20f 100644
--- a/testcases/kernel/syscalls/sched_getscheduler/sched_getscheduler01.c
+++ b/testcases/kernel/syscalls/sched_getscheduler/sched_getscheduler01.c
@@ -83,8 +83,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup();
@@ -128,7 +132,7 @@
cleanup();
return -1;
- /*NOTREACHED*/}
+ }
/*
* setup() - performs all ONE TIME setup for this test.
@@ -137,7 +141,7 @@
{
/* Must run test as root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Must run test as root");
+ tst_brkm(TBROK, NULL, "Must run test as root");
}
/* capture signals */
diff --git a/testcases/kernel/syscalls/sched_getscheduler/sched_getscheduler02.c b/testcases/kernel/syscalls/sched_getscheduler/sched_getscheduler02.c
index 276af97..4379a28 100644
--- a/testcases/kernel/syscalls/sched_getscheduler/sched_getscheduler02.c
+++ b/testcases/kernel/syscalls/sched_getscheduler/sched_getscheduler02.c
@@ -64,8 +64,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup();
@@ -94,7 +98,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
diff --git a/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c b/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c
index 7e42fb9..159fb59 100644
--- a/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c
+++ b/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c
@@ -85,9 +85,15 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -118,7 +124,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval02.c b/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval02.c
index dfd637f..3b77540 100644
--- a/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval02.c
+++ b/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval02.c
@@ -86,9 +86,15 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -123,7 +129,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval03.c b/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval03.c
index 27f63ec..33ad77a 100644
--- a/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval03.c
+++ b/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval03.c
@@ -109,9 +109,15 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -144,7 +150,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
diff --git a/testcases/kernel/syscalls/sched_setparam/sched_setparam01.c b/testcases/kernel/syscalls/sched_setparam/sched_setparam01.c
index a5125f8..fccb9e1 100644
--- a/testcases/kernel/syscalls/sched_setparam/sched_setparam01.c
+++ b/testcases/kernel/syscalls/sched_setparam/sched_setparam01.c
@@ -83,10 +83,8 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL))
- != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/* perform global setup for test */
setup();
@@ -115,7 +113,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -145,7 +143,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
} /* End cleanup() */
diff --git a/testcases/kernel/syscalls/sched_setparam/sched_setparam02.c b/testcases/kernel/syscalls/sched_setparam/sched_setparam02.c
index a21d8fe..d3a3efd 100644
--- a/testcases/kernel/syscalls/sched_setparam/sched_setparam02.c
+++ b/testcases/kernel/syscalls/sched_setparam/sched_setparam02.c
@@ -11,8 +11,6 @@
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
*/
/**********************************************************
*
@@ -102,10 +100,8 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL))
- != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/* perform global setup for test */
setup();
@@ -148,7 +144,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -175,9 +171,6 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
} /* End cleanup() */
/*
diff --git a/testcases/kernel/syscalls/sched_setparam/sched_setparam03.c b/testcases/kernel/syscalls/sched_setparam/sched_setparam03.c
index 95f1d17..b875446 100644
--- a/testcases/kernel/syscalls/sched_setparam/sched_setparam03.c
+++ b/testcases/kernel/syscalls/sched_setparam/sched_setparam03.c
@@ -95,10 +95,8 @@
pid_t child_pid;
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL))
- != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/* perform global setup for test */
setup();
@@ -127,7 +125,7 @@
TEST(sched_setparam(getppid(), ¶m));
if (TEST_RETURN == -1) {
- tst_resm(TWARN|TTERRNO, "sched_setparam() returned %ld", TEST_RETURN);
+ perror("sched_setparam returned %ld", TEST_RETURN);
exit(0);
}
exit(1);
@@ -155,7 +153,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -189,9 +187,6 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
} /* End cleanup() */
/*
diff --git a/testcases/kernel/syscalls/sched_setparam/sched_setparam04.c b/testcases/kernel/syscalls/sched_setparam/sched_setparam04.c
index 2db4656..4b98213 100644
--- a/testcases/kernel/syscalls/sched_setparam/sched_setparam04.c
+++ b/testcases/kernel/syscalls/sched_setparam/sched_setparam04.c
@@ -117,10 +117,8 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL))
- != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
setup(); /* global setup */
@@ -153,7 +151,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
diff --git a/testcases/kernel/syscalls/sched_setparam/sched_setparam05.c b/testcases/kernel/syscalls/sched_setparam/sched_setparam05.c
index 31ecc10..5787805 100644
--- a/testcases/kernel/syscalls/sched_setparam/sched_setparam05.c
+++ b/testcases/kernel/syscalls/sched_setparam/sched_setparam05.c
@@ -99,10 +99,8 @@
pid_t child_pid;
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL))
- != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/* perform global setup for test */
setup();
@@ -125,7 +123,7 @@
/* Switch to nobody user */
if ((ltpuser = getpwnam(nobody_uid)) == NULL) {
- tst_brkm(TBROK, tst_exit, "\"nobody\" user"
+ tst_brkm(TBROK, NULL, "\"nobody\" user"
"not present");
}
if (seteuid(ltpuser->pw_uid) == -1) {
@@ -168,7 +166,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -178,7 +176,7 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* capture signals */
@@ -204,7 +202,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
} /* End cleanup() */
diff --git a/testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler01.c b/testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler01.c
index e33806f..2f27373 100644
--- a/testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler01.c
+++ b/testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler01.c
@@ -105,8 +105,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
/* check looping state if -i option is given */
for (lc = 0; TEST_LOOPING(lc); lc++) {
@@ -144,7 +148,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
diff --git a/testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler02.c b/testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler02.c
index aa64932..74b8c47 100644
--- a/testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler02.c
+++ b/testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler02.c
@@ -80,8 +80,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup();
@@ -136,7 +140,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
@@ -147,7 +151,7 @@
{
/* must run test as root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Must run test as root");
+ tst_brkm(TBROK, NULL, "Must run test as root");
}
/* capture signals */
diff --git a/testcases/kernel/syscalls/sched_yield/sched_yield01.c b/testcases/kernel/syscalls/sched_yield/sched_yield01.c
index 6271598..40bbffa 100644
--- a/testcases/kernel/syscalls/sched_yield/sched_yield01.c
+++ b/testcases/kernel/syscalls/sched_yield/sched_yield01.c
@@ -62,8 +62,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup();
@@ -84,7 +88,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
diff --git a/testcases/kernel/syscalls/send/send01.c b/testcases/kernel/syscalls/send/send01.c
index 4f38a32..81f9e07 100644
--- a/testcases/kernel/syscalls/send/send01.c
+++ b/testcases/kernel/syscalls/send/send01.c
@@ -154,7 +154,7 @@
return pid;
}
- /*NOTREACHED*/ exit(1);
+ exit(1);
}
void do_child()
@@ -204,9 +204,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
argv0 = av[0];
@@ -251,7 +257,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
pid_t pid;
diff --git a/testcases/kernel/syscalls/sendfile/sendfile02.c b/testcases/kernel/syscalls/sendfile/sendfile02.c
index c621438..8d89a11 100644
--- a/testcases/kernel/syscalls/sendfile/sendfile02.c
+++ b/testcases/kernel/syscalls/sendfile/sendfile02.c
@@ -109,22 +109,22 @@
if ((in_fd = open(in_file, O_RDONLY)) < 0) {
tst_brkm(TBROK, cleanup, "open failed: %d", errno);
- /*NOTREACHED*/}
+ }
if (stat(in_file, &sb) < 0) {
tst_brkm(TBROK, cleanup, "stat failed: %d", errno);
- /*NOTREACHED*/}
+ }
if ((before_pos = lseek(in_fd, 0, SEEK_CUR)) < 0) {
tst_brkm(TBROK, cleanup,
"lseek before invoking sendfile failed: %d", errno);
- /*NOTREACHED*/}
+ }
TEST(sendfile(out_fd, in_fd, &offset, sb.st_size - offset));
if ((after_pos = lseek(in_fd, 0, SEEK_CUR)) < 0) {
tst_brkm(TBROK, cleanup,
"lseek after invoking sendfile failed: %d", errno);
- /*NOTREACHED*/}
+ }
if (STD_FUNCTIONAL_TEST) {
/* Close the sockets */
@@ -204,11 +204,11 @@
if ((fd = creat(in_file, 00700)) < 0) {
tst_brkm(TBROK, cleanup, "creat failed in setup, errno: %d",
errno);
- /*NOTREACHED*/}
+ }
sprintf(buf, "abcdefghijklmnopqrstuvwxyz");
if (write(fd, buf, strlen(buf)) < 0) {
tst_brkm(TBROK, cleanup, "write failed, errno: %d", errno);
- /*NOTREACHED*/}
+ }
close(fd);
sprintf(out_file, "out.%d", getpid());
}
@@ -292,8 +292,12 @@
char *msg; /* parse_opts() return message */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
#ifdef UCLINUX
argv0 = av[0];
maybe_run_child(&do_child, "");
@@ -313,5 +317,5 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
diff --git a/testcases/kernel/syscalls/sendfile/sendfile03.c b/testcases/kernel/syscalls/sendfile/sendfile03.c
index 48b83c4..6809900 100644
--- a/testcases/kernel/syscalls/sendfile/sendfile03.c
+++ b/testcases/kernel/syscalls/sendfile/sendfile03.c
@@ -95,8 +95,12 @@
char *msg; /* parse_opts() return message */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup();
@@ -135,7 +139,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -158,19 +162,19 @@
if ((in_fd = creat(in_file, 00700)) < 0) {
tst_brkm(TBROK, cleanup, "creat failed in setup, errno: %d",
errno);
- /*NOTREACHED*/}
+ }
sprintf(buf, "abcdefghijklmnopqrstuvwxyz");
if (write(in_fd, buf, strlen(buf)) < 0) {
tst_brkm(TBROK, cleanup, "write failed, errno: %d", errno);
- /*NOTREACHED*/}
+ }
close(in_fd);
if ((in_fd = open(in_file, O_RDONLY)) < 0) {
tst_brkm(TBROK, cleanup, "open failed, errno: %d", errno);
- /*NOTREACHED*/}
+ }
sprintf(out_file, "out.%d", getpid());
if ((out_fd = open(out_file, O_TRUNC | O_CREAT | O_RDWR, 0777)) < 0) {
tst_brkm(TBROK, cleanup, "open failed, errno: %d", errno);
- /*NOTREACHED*/}
+ }
}
/*
diff --git a/testcases/kernel/syscalls/sendfile/sendfile04.c b/testcases/kernel/syscalls/sendfile/sendfile04.c
index 8a07363..bfb671d 100644
--- a/testcases/kernel/syscalls/sendfile/sendfile04.c
+++ b/testcases/kernel/syscalls/sendfile/sendfile04.c
@@ -109,21 +109,21 @@
prot, MAP_SHARED | MAP_ANONYMOUS, -1, 0);
if (protected_buffer == MAP_FAILED) {
tst_brkm(TBROK, cleanup, "mmap failed: %d", errno);
- /*NOTREACHED*/}
+ }
out_fd = create_server();
if ((in_fd = open(in_file, O_RDONLY)) < 0) {
tst_brkm(TBROK, cleanup, "open failed: %d", errno);
- /*NOTREACHED*/}
+ }
if (stat(in_file, &sb) < 0) {
tst_brkm(TBROK, cleanup, "stat failed: %d", errno);
- /*NOTREACHED*/}
+ }
if (pass_unmapped_buffer) {
if (munmap(protected_buffer, sizeof(*protected_buffer)) < 0) {
tst_brkm(TBROK, cleanup, "munmap failed: %d", errno);
- /*NOTREACHED*/}
+ }
}
TEST(sendfile(out_fd, in_fd, protected_buffer, sb.st_size));
@@ -191,11 +191,11 @@
if ((fd = creat(in_file, 00700)) < 0) {
tst_brkm(TBROK, cleanup, "creat failed in setup, errno: %d",
errno);
- /*NOTREACHED*/}
+ }
sprintf(buf, "abcdefghijklmnopqrstuvwxyz");
if (write(fd, buf, strlen(buf)) < 0) {
tst_brkm(TBROK, cleanup, "write failed, errno: %d", errno);
- /*NOTREACHED*/}
+ }
close(fd);
sprintf(out_file, "out.%d", getpid());
}
@@ -279,8 +279,12 @@
char *msg; /* parse_opts() return message */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
#ifdef UCLINUX
argv0 = av[0];
maybe_run_child(&do_child, "");
@@ -301,5 +305,5 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
diff --git a/testcases/kernel/syscalls/sendfile/sendfile05.c b/testcases/kernel/syscalls/sendfile/sendfile05.c
index 558c412..6cff59e 100644
--- a/testcases/kernel/syscalls/sendfile/sendfile05.c
+++ b/testcases/kernel/syscalls/sendfile/sendfile05.c
@@ -89,10 +89,10 @@
if ((in_fd = open(in_file, O_RDONLY)) < 0) {
tst_brkm(TBROK, cleanup, "open failed: %d", errno);
- /*NOTREACHED*/}
+ }
if (stat(in_file, &sb) < 0) {
tst_brkm(TBROK, cleanup, "stat failed: %d", errno);
- /*NOTREACHED*/}
+ }
offset = -1;
TEST(sendfile(out_fd, in_fd, &offset, sb.st_size));
@@ -155,11 +155,11 @@
if ((fd = creat(in_file, 00700)) < 0) {
tst_brkm(TBROK, cleanup, "creat failed in setup, errno: %d",
errno);
- /*NOTREACHED*/}
+ }
sprintf(buf, "abcdefghijklmnopqrstuvwxyz");
if (write(fd, buf, strlen(buf)) < 0) {
tst_brkm(TBROK, cleanup, "write failed, errno: %d", errno);
- /*NOTREACHED*/}
+ }
close(fd);
sprintf(out_file, "out.%d", getpid());
}
@@ -242,8 +242,12 @@
char *msg; /* parse_opts() return message */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
#ifdef UCLINUX
argv0 = av[0];
maybe_run_child(&do_child, "");
@@ -261,5 +265,5 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
diff --git a/testcases/kernel/syscalls/sendfile/sendfile06.c b/testcases/kernel/syscalls/sendfile/sendfile06.c
index b2a47d8..da8cbbb 100644
--- a/testcases/kernel/syscalls/sendfile/sendfile06.c
+++ b/testcases/kernel/syscalls/sendfile/sendfile06.c
@@ -93,16 +93,16 @@
if ((in_fd = open(in_file, O_RDONLY)) < 0) {
tst_brkm(TBROK, cleanup, "open failed: %d", errno);
- /*NOTREACHED*/}
+ }
if (stat(in_file, &sb) < 0) {
tst_brkm(TBROK, cleanup, "stat failed: %d", errno);
- /*NOTREACHED*/}
+ }
TEST(sendfile(out_fd, in_fd, NULL, sb.st_size));
if ((after_pos = lseek(in_fd, 0, SEEK_CUR)) < 0) {
tst_brkm(TBROK, cleanup,
"lseek after invoking sendfile failed: %d", errno);
- /*NOTREACHED*/}
+ }
if (STD_FUNCTIONAL_TEST) {
/* Close the sockets */
@@ -177,11 +177,11 @@
if ((fd = creat(in_file, 00700)) < 0) {
tst_brkm(TBROK, cleanup, "creat failed in setup, errno: %d",
errno);
- /*NOTREACHED*/}
+ }
sprintf(buf, "abcdefghijklmnopqrstuvwxyz");
if (write(fd, buf, strlen(buf)) < 0) {
tst_brkm(TBROK, cleanup, "write failed, errno: %d", errno);
- /*NOTREACHED*/}
+ }
close(fd);
sprintf(out_file, "out.%d", getpid());
}
@@ -264,8 +264,12 @@
char *msg; /* parse_opts() return message */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
#ifdef UCLINUX
argv0 = av[0];
maybe_run_child(&do_child, "");
@@ -283,5 +287,5 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
diff --git a/testcases/kernel/syscalls/sendfile/sendfile07.c b/testcases/kernel/syscalls/sendfile/sendfile07.c
index 9e96218..8f04f99 100644
--- a/testcases/kernel/syscalls/sendfile/sendfile07.c
+++ b/testcases/kernel/syscalls/sendfile/sendfile07.c
@@ -81,8 +81,12 @@
char *msg; /* parse_opts() return message */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup();
@@ -113,7 +117,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -138,20 +142,20 @@
if ((in_fd = creat(in_file, 00700)) < 0) {
tst_brkm(TBROK, cleanup, "creat failed in setup, errno: %d",
errno);
- /*NOTREACHED*/}
+ }
sprintf(buf, "abcdefghijklmnopqrstuvwxyz");
if (write(in_fd, buf, strlen(buf)) < 0) {
tst_brkm(TBROK, cleanup, "write failed, errno: %d", errno);
- /*NOTREACHED*/}
+ }
close(in_fd);
if ((in_fd = open(in_file, O_RDONLY)) < 0) {
tst_brkm(TBROK, cleanup, "open failed, errno: %d", errno);
- /*NOTREACHED*/}
+ }
/* Make fulfilled out_fd. */
if (socketpair(PF_UNIX, SOCK_DGRAM, 0, p) < 0) {
tst_brkm(TBROK, cleanup, "socketpair failed, errno: %d", errno);
- /*NOTREACHED*/}
+ }
/* Don't close.
You cannot write nothing on out_fd if ignored_fd is closed. */
diff --git a/testcases/kernel/syscalls/sendmsg/sendmsg01.c b/testcases/kernel/syscalls/sendmsg/sendmsg01.c
index db0975e..134a181 100644
--- a/testcases/kernel/syscalls/sendmsg/sendmsg01.c
+++ b/testcases/kernel/syscalls/sendmsg/sendmsg01.c
@@ -230,7 +230,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -343,7 +347,7 @@
return pid;
}
- /*NOTREACHED*/ exit(1);
+ exit(1);
}
void do_child()
diff --git a/testcases/kernel/syscalls/sendto/sendto01.c b/testcases/kernel/syscalls/sendto/sendto01.c
index a98954d..ce1f91e 100644
--- a/testcases/kernel/syscalls/sendto/sendto01.c
+++ b/testcases/kernel/syscalls/sendto/sendto01.c
@@ -177,7 +177,7 @@
return pid;
}
- /*NOTREACHED*/ exit(1);
+ exit(1);
}
void do_child()
@@ -227,9 +227,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
#ifdef UCLINUX
argv0 = av[0];
@@ -274,7 +280,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
pid_t pid;
diff --git a/testcases/kernel/syscalls/set_robust_list/set_robust_list01.c b/testcases/kernel/syscalls/set_robust_list/set_robust_list01.c
index 2f76d86..5e07d89 100644
--- a/testcases/kernel/syscalls/set_robust_list/set_robust_list01.c
+++ b/testcases/kernel/syscalls/set_robust_list/set_robust_list01.c
@@ -90,7 +90,11 @@
int retval;
#endif
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
diff --git a/testcases/kernel/syscalls/set_thread_area/set_thread_area01.c b/testcases/kernel/syscalls/set_thread_area/set_thread_area01.c
index 6388340..27c8b01 100644
--- a/testcases/kernel/syscalls/set_thread_area/set_thread_area01.c
+++ b/testcases/kernel/syscalls/set_thread_area/set_thread_area01.c
@@ -116,7 +116,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
tst_exit();
}
diff --git a/testcases/kernel/syscalls/set_thread_area/set_thread_area02.c b/testcases/kernel/syscalls/set_thread_area/set_thread_area02.c
index 03fee58..54e5b37 100644
--- a/testcases/kernel/syscalls/set_thread_area/set_thread_area02.c
+++ b/testcases/kernel/syscalls/set_thread_area/set_thread_area02.c
@@ -53,7 +53,6 @@
/* Global Variables */
char *TCID = "set_thread_area_02"; /* Test program identifier.*/
-int testno;
int TST_TOTAL = 3; /* total number of tests in this file. */
#if defined(HAVE_ASM_LDT_H) && defined(HAVE_STRUCT_USER_DESC)
@@ -83,9 +82,6 @@
/* Remove tmp dir and all files in it */
TEST_CLEANUP;
tst_rmdir();
-
- /* Exit with appropriate return code. */
- tst_exit();
}
/* Local Functions */
@@ -116,81 +112,46 @@
int main(int ac, char **av) {
thread_area_s u_info;
- int lc; /* loop counter */
- char *msg; /* message returned from parse_opts */
-
- /* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
- tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
setup();
- /* Check looping state if -i option given */
- for (lc = 0; TEST_LOOPING(lc); ++lc) {
-
- Tst_count = 0;
-
- for (testno = 0; testno < TST_TOTAL; ++testno) {
-
- u_info.entry_number = 6;
+ u_info.entry_number = 6;
- /*
- * This call to get_thread_area function should be sucessful.
- */
+ TEST(syscall(__NR_get_thread_area, &u_info)); //call get_thread_area()
+ if (TEST_RETURN == -1) {
+ tst_brkm(TFAIL|TTERRNO, cleanup, "call get_thread_area() failed");
+ }
- TEST(syscall(__NR_get_thread_area, &u_info)); //call get_thread_area()
- if (TEST_RETURN == -1) {
- tst_resm(TFAIL | TTERRNO, "call get_thread_area() failed");
- cleanup();
- tst_exit();
- }
-
- u_info.entry_number = -2;
- /*
- * This call to set_thread_area function with invalid entry_number should be FAILED.
- */
+ u_info.entry_number = -2;
+ TEST(syscall(__NR_set_thread_area, &u_info)); //call set_thread_area()
+ if (TEST_RETURN == -1) {
- TEST(syscall(__NR_set_thread_area, &u_info)); //call set_thread_area()
- if (TEST_RETURN == -1) {
-
- if (TEST_ERRNO == EINVAL) {
- tst_resm(TPASS, "Call to set_thread_area call failed with invalid entry_number errno = %d (expected EINVAL)",TEST_ERRNO);
- } else {
- tst_resm(TFAIL,"Call to set_thread_area with invalid entry_number got unexpected errno = %d (expected EINVAL)",TEST_ERRNO);
- }
-
- } else {
- tst_resm(TFAIL,"Call to set_thread_area with invalid entry_number succeed,but should fail" );
- cleanup();
- tst_exit();
- }
-
- /*
- * This call to set_thread_area function with an invalid pointer should be FAILED with EFAULT.
- */
-
- TEST(syscall(__NR_set_thread_area,(struct user_desc *)-9)); //call set_thread_area()
- if (TEST_RETURN == -1) {
- if (TEST_ERRNO == EFAULT) {
- tst_resm(TPASS, "Call to set_thread_area call with invalid entry_number errno = %d (got expected error EFAULT)",TEST_ERRNO);
- } else {
- tst_resm(TFAIL,"Call to set_thread_area with invalid entry_number got unexpected errno = %d (expected EFAULT)",TEST_ERRNO);
- }
- } else {
- tst_resm(TFAIL,"Call to set_thread_area with invalid entry_number succeed,but should fail" );
- tst_exit();
- }
+ if (TEST_ERRNO == EINVAL) {
+ tst_resm(TPASS, "set_thread_area failed with EINVAL as expected");
+ } else {
+ tst_resm(TFAIL|TTERRNO, "set_thread_area didn't fail with EINVAL");
}
+
+ } else {
+ tst_brkm(TFAIL, cleanup, "set_thread_area succeeded unexpectedly");
+ }
+
+ TEST(syscall(__NR_set_thread_area,(struct user_desc *)-9)); //call set_thread_area()
+ if (TEST_RETURN == -1) {
+ if (TEST_ERRNO == EFAULT) {
+ tst_resm(TPASS, "set_thread_area failed with EFAULT as expected");
+ } else {
+ tst_resm(TFAIL|TTERRNO, "set_thread_area didn't fail with EFAULT");
+ }
+ } else {
+ tst_resm(TFAIL, cleanup, "set_thread_area succeeded unexpectedly");
}
cleanup();
tst_exit();
}
#else
int main(void) {
- tst_resm(TCONF, "is not available for this architecture");
- tst_exit();
+ tst_brkm(TCONF, NULL, "set_thread_area isn't available for this architecture");
}
#endif
diff --git a/testcases/kernel/syscalls/set_tid_address/set_tid_address01.c b/testcases/kernel/syscalls/set_tid_address/set_tid_address01.c
index 7a00402..2a6e737 100644
--- a/testcases/kernel/syscalls/set_tid_address/set_tid_address01.c
+++ b/testcases/kernel/syscalls/set_tid_address/set_tid_address01.c
@@ -114,7 +114,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
tst_exit();
}
diff --git a/testcases/kernel/syscalls/setdomainname/setdomainname01.c b/testcases/kernel/syscalls/setdomainname/setdomainname01.c
index 567e230..a95552c 100644
--- a/testcases/kernel/syscalls/setdomainname/setdomainname01.c
+++ b/testcases/kernel/syscalls/setdomainname/setdomainname01.c
@@ -123,7 +123,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -136,12 +136,12 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* Save current domain name */
if ((getdomainname(old_domain_name, sizeof(old_domain_name))) < 0) {
- tst_brkm(TBROK, tst_exit, "getdomainname() failed while"
+ tst_brkm(TBROK, NULL, "getdomainname() failed while"
" getting current domain name");
}
diff --git a/testcases/kernel/syscalls/setdomainname/setdomainname02.c b/testcases/kernel/syscalls/setdomainname/setdomainname02.c
index 0ab3570..2acac5d 100644
--- a/testcases/kernel/syscalls/setdomainname/setdomainname02.c
+++ b/testcases/kernel/syscalls/setdomainname/setdomainname02.c
@@ -114,7 +114,11 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+>>>>>>> master
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -153,7 +157,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
@@ -171,12 +175,12 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* Save current domainname */
if ((getdomainname(old_domain_name, MAX_NAME_LEN)) < 0) {
- tst_brkm(TBROK, tst_exit, "getdomainname() failed while"
+ tst_brkm(TBROK, NULL, "getdomainname() failed while"
" getting current domain name");
}
diff --git a/testcases/kernel/syscalls/setdomainname/setdomainname03.c b/testcases/kernel/syscalls/setdomainname/setdomainname03.c
index 08107cf..b3c1659 100644
--- a/testcases/kernel/syscalls/setdomainname/setdomainname03.c
+++ b/testcases/kernel/syscalls/setdomainname/setdomainname03.c
@@ -101,7 +101,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -141,7 +145,7 @@
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -159,10 +163,10 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
if ((ltpuser = getpwnam(nobody_uid)) == NULL) {
- tst_brkm(TBROK, tst_exit, "\"nobody\" user not present");
+ tst_brkm(TBROK, NULL, "\"nobody\" user not present");
}
if (seteuid(ltpuser->pw_uid) == -1) {
tst_resm(TWARN, "seteuid failed to "
@@ -172,7 +176,7 @@
/* Save current domainname */
if ((getdomainname(old_domain_name, MAX_NAME_LEN)) < 0) {
- tst_brkm(TBROK, tst_exit, "getdomainname() failed while"
+ tst_brkm(TBROK, NULL, "getdomainname() failed while"
" getting current domain name");
}
diff --git a/testcases/kernel/syscalls/setfsgid/setfsgid01.c b/testcases/kernel/syscalls/setfsgid/setfsgid01.c
index 1e2fe6b..c7a68cd 100644
--- a/testcases/kernel/syscalls/setfsgid/setfsgid01.c
+++ b/testcases/kernel/syscalls/setfsgid/setfsgid01.c
@@ -68,7 +68,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -103,7 +107,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
diff --git a/testcases/kernel/syscalls/setfsgid/setfsgid02.c b/testcases/kernel/syscalls/setfsgid/setfsgid02.c
index d0844d3..d4711b5 100644
--- a/testcases/kernel/syscalls/setfsgid/setfsgid02.c
+++ b/testcases/kernel/syscalls/setfsgid/setfsgid02.c
@@ -72,7 +72,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -110,7 +114,7 @@
}
cleanup();
- /*NOTREACHED*/ return EXIT_SUCCESS;
+ return EXIT_SUCCESS;
}
/*
diff --git a/testcases/kernel/syscalls/setfsgid/setfsgid03.c b/testcases/kernel/syscalls/setfsgid/setfsgid03.c
index 36a4144..addbaa4 100644
--- a/testcases/kernel/syscalls/setfsgid/setfsgid03.c
+++ b/testcases/kernel/syscalls/setfsgid/setfsgid03.c
@@ -74,7 +74,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -113,7 +117,7 @@
}
cleanup();
- /*NOTREACHED*/ return EXIT_SUCCESS;
+ return EXIT_SUCCESS;
}
/*
@@ -123,7 +127,7 @@
{
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/setfsuid/setfsuid01.c b/testcases/kernel/syscalls/setfsuid/setfsuid01.c
index 2603388..758e12d 100644
--- a/testcases/kernel/syscalls/setfsuid/setfsuid01.c
+++ b/testcases/kernel/syscalls/setfsuid/setfsuid01.c
@@ -69,7 +69,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -105,7 +109,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
diff --git a/testcases/kernel/syscalls/setfsuid/setfsuid02.c b/testcases/kernel/syscalls/setfsuid/setfsuid02.c
index fcba413..333d6d5 100644
--- a/testcases/kernel/syscalls/setfsuid/setfsuid02.c
+++ b/testcases/kernel/syscalls/setfsuid/setfsuid02.c
@@ -74,7 +74,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -114,7 +118,7 @@
cleanup();
return 0;
- /*NOTREACHED*/}
+ }
/*
* setup() - performs all ONE TIME setup for this test.
diff --git a/testcases/kernel/syscalls/setfsuid/setfsuid03.c b/testcases/kernel/syscalls/setfsuid/setfsuid03.c
index 760615e..b6f6c0f 100644
--- a/testcases/kernel/syscalls/setfsuid/setfsuid03.c
+++ b/testcases/kernel/syscalls/setfsuid/setfsuid03.c
@@ -75,7 +75,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -118,7 +122,7 @@
return 0;
- /*NOTREACHED*/}
+ }
/*
* setup() - performs all ONE TIME setup for this test.
@@ -127,7 +131,7 @@
{
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/setfsuid/setfsuid04.c b/testcases/kernel/syscalls/setfsuid/setfsuid04.c
index d445915..aeb7ee9 100644
--- a/testcases/kernel/syscalls/setfsuid/setfsuid04.c
+++ b/testcases/kernel/syscalls/setfsuid/setfsuid04.c
@@ -78,8 +78,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
/*
* perform global setup for the test
@@ -103,7 +107,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -209,7 +213,7 @@
void setup(void)
{
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
diff --git a/testcases/kernel/syscalls/setgid/setgid01.c b/testcases/kernel/syscalls/setgid/setgid01.c
index 8d3d7d8..d525d4b 100644
--- a/testcases/kernel/syscalls/setgid/setgid01.c
+++ b/testcases/kernel/syscalls/setgid/setgid01.c
@@ -136,7 +136,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/setgid/setgid02.c b/testcases/kernel/syscalls/setgid/setgid02.c
index 58b7af3..edc2fab 100644
--- a/testcases/kernel/syscalls/setgid/setgid02.c
+++ b/testcases/kernel/syscalls/setgid/setgid02.c
@@ -73,8 +73,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup();
@@ -115,7 +119,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -125,7 +129,7 @@
{
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
diff --git a/testcases/kernel/syscalls/setgid/setgid03.c b/testcases/kernel/syscalls/setgid/setgid03.c
index 403d20a..9f196b5 100644
--- a/testcases/kernel/syscalls/setgid/setgid03.c
+++ b/testcases/kernel/syscalls/setgid/setgid03.c
@@ -68,8 +68,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup();
@@ -100,7 +104,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -110,7 +114,7 @@
{
/* test must be run as root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* capture signals */
diff --git a/testcases/kernel/syscalls/setgroups/setgroups02.c b/testcases/kernel/syscalls/setgroups/setgroups02.c
index 1626acc..a009712 100644
--- a/testcases/kernel/syscalls/setgroups/setgroups02.c
+++ b/testcases/kernel/syscalls/setgroups/setgroups02.c
@@ -94,9 +94,15 @@
int PASS_FLAG = 0; /* used for checking group array */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform global setup for test */
@@ -158,7 +164,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -174,7 +180,7 @@
/* Make sure the calling process is super-user only */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Must be ROOT to run this test.");
+ tst_brkm(TBROK, NULL, "Must be ROOT to run this test.");
}
/* Pause if that option was specified */
diff --git a/testcases/kernel/syscalls/setgroups/setgroups03.c b/testcases/kernel/syscalls/setgroups/setgroups03.c
index df59c32..c7e4659 100644
--- a/testcases/kernel/syscalls/setgroups/setgroups03.c
+++ b/testcases/kernel/syscalls/setgroups/setgroups03.c
@@ -116,9 +116,15 @@
int ngroups_max = sysconf(_SC_NGROUPS_MAX); /* max no. of groups in the current system */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
groups_list = malloc(ngroups_max * sizeof(GID_T));
@@ -181,7 +187,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -193,7 +199,7 @@
{
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* capture signals */
diff --git a/testcases/kernel/syscalls/setgroups/setgroups04.c b/testcases/kernel/syscalls/setgroups/setgroups04.c
index 9e9a955..82a436b 100644
--- a/testcases/kernel/syscalls/setgroups/setgroups04.c
+++ b/testcases/kernel/syscalls/setgroups/setgroups04.c
@@ -92,9 +92,15 @@
char *test_desc; /* test specific error message */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* Perform setup for test */
@@ -143,7 +149,7 @@
/* Call cleanup() */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
#else
@@ -164,7 +170,7 @@
/* check root user */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* capture signals */
diff --git a/testcases/kernel/syscalls/sethostname/sethostname01.c b/testcases/kernel/syscalls/sethostname/sethostname01.c
index fbc386c..1bf4c59 100644
--- a/testcases/kernel/syscalls/sethostname/sethostname01.c
+++ b/testcases/kernel/syscalls/sethostname/sethostname01.c
@@ -138,12 +138,12 @@
/* Test should be executed as root user */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* Store the existing hostname to retain it before exiting */
if ((ret = gethostname(hname, sizeof(hname))) < 0) {
- tst_brkm(TBROK, tst_exit, "gethostname() failed while getting"
+ tst_brkm(TBROK, NULL, "gethostname() failed while getting"
" current host name");
}
diff --git a/testcases/kernel/syscalls/sethostname/sethostname02.c b/testcases/kernel/syscalls/sethostname/sethostname02.c
index bf7ad55..dfdebc2 100644
--- a/testcases/kernel/syscalls/sethostname/sethostname02.c
+++ b/testcases/kernel/syscalls/sethostname/sethostname02.c
@@ -178,12 +178,12 @@
/* Test should be executed as root user */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* Keep the host name before starting the test */
if ((ret = gethostname(hname, sizeof(hname))) < 0) {
- tst_brkm(TBROK, tst_exit, "gethostname() failed while"
+ tst_brkm(TBROK, NULL, "gethostname() failed while"
" getting current host name");
}
diff --git a/testcases/kernel/syscalls/sethostname/sethostname03.c b/testcases/kernel/syscalls/sethostname/sethostname03.c
index 9255129..d90d327 100644
--- a/testcases/kernel/syscalls/sethostname/sethostname03.c
+++ b/testcases/kernel/syscalls/sethostname/sethostname03.c
@@ -145,12 +145,12 @@
/* Test should be executed as root user */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* Switch to nobody user for correct error code collection */
if ((ltpuser = getpwnam(nobody_uid)) == NULL) {
- tst_brkm(TBROK, tst_exit, "Required user \"nobody\" not"
+ tst_brkm(TBROK, NULL, "Required user \"nobody\" not"
" present");
}
@@ -162,7 +162,7 @@
/* Keep current hostname */
if ((ret = gethostname(hname, sizeof(hname))) < 0) {
- tst_brkm(TBROK, tst_exit, "gethostname() failed while"
+ tst_brkm(TBROK, NULL, "gethostname() failed while"
" getting current host name");
}
diff --git a/testcases/kernel/syscalls/setitimer/setitimer01.c b/testcases/kernel/syscalls/setitimer/setitimer01.c
index b4fc8ab..8b00bd3 100644
--- a/testcases/kernel/syscalls/setitimer/setitimer01.c
+++ b/testcases/kernel/syscalls/setitimer/setitimer01.c
@@ -76,7 +76,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -148,7 +152,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
diff --git a/testcases/kernel/syscalls/setitimer/setitimer02.c b/testcases/kernel/syscalls/setitimer/setitimer02.c
index 5177b0d..978dc85 100644
--- a/testcases/kernel/syscalls/setitimer/setitimer02.c
+++ b/testcases/kernel/syscalls/setitimer/setitimer02.c
@@ -77,7 +77,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -139,7 +143,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
diff --git a/testcases/kernel/syscalls/setitimer/setitimer03.c b/testcases/kernel/syscalls/setitimer/setitimer03.c
index beae6c1..d8dffe4 100644
--- a/testcases/kernel/syscalls/setitimer/setitimer03.c
+++ b/testcases/kernel/syscalls/setitimer/setitimer03.c
@@ -75,7 +75,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -148,7 +152,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
diff --git a/testcases/kernel/syscalls/setpgid/setpgid01.c b/testcases/kernel/syscalls/setpgid/setpgid01.c
index d9cf346..5060504 100644
--- a/testcases/kernel/syscalls/setpgid/setpgid01.c
+++ b/testcases/kernel/syscalls/setpgid/setpgid01.c
@@ -136,7 +136,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/setpgid/setpgid02.c b/testcases/kernel/syscalls/setpgid/setpgid02.c
index 6598fa1..a8b7041 100644
--- a/testcases/kernel/syscalls/setpgid/setpgid02.c
+++ b/testcases/kernel/syscalls/setpgid/setpgid02.c
@@ -93,7 +93,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -133,7 +137,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
diff --git a/testcases/kernel/syscalls/setpgid/setpgid03.c b/testcases/kernel/syscalls/setpgid/setpgid03.c
index cec9fa6..370978f 100644
--- a/testcases/kernel/syscalls/setpgid/setpgid03.c
+++ b/testcases/kernel/syscalls/setpgid/setpgid03.c
@@ -64,8 +64,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
#ifdef UCLINUX
maybe_run_child(&do_child, "");
#endif
diff --git a/testcases/kernel/syscalls/setpgrp/setpgrp02.c b/testcases/kernel/syscalls/setpgrp/setpgrp02.c
index e516194..06a72a7 100644
--- a/testcases/kernel/syscalls/setpgrp/setpgrp02.c
+++ b/testcases/kernel/syscalls/setpgrp/setpgrp02.c
@@ -66,7 +66,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -119,7 +123,7 @@
}
}
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
diff --git a/testcases/kernel/syscalls/setpriority/setpriority01.c b/testcases/kernel/syscalls/setpriority/setpriority01.c
index bdd4dc1..f5dfdb7 100644
--- a/testcases/kernel/syscalls/setpriority/setpriority01.c
+++ b/testcases/kernel/syscalls/setpriority/setpriority01.c
@@ -78,7 +78,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -135,7 +139,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
diff --git a/testcases/kernel/syscalls/setpriority/setpriority02.c b/testcases/kernel/syscalls/setpriority/setpriority02.c
index c30a07b..70e6cb9 100644
--- a/testcases/kernel/syscalls/setpriority/setpriority02.c
+++ b/testcases/kernel/syscalls/setpriority/setpriority02.c
@@ -79,7 +79,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -120,7 +124,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
@@ -131,7 +135,7 @@
{
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (seteuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/setpriority/setpriority03.c b/testcases/kernel/syscalls/setpriority/setpriority03.c
index 1af40b8..75756d9 100644
--- a/testcases/kernel/syscalls/setpriority/setpriority03.c
+++ b/testcases/kernel/syscalls/setpriority/setpriority03.c
@@ -78,7 +78,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -119,7 +123,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
diff --git a/testcases/kernel/syscalls/setpriority/setpriority04.c b/testcases/kernel/syscalls/setpriority/setpriority04.c
index 7cfd13a..52a68aa 100644
--- a/testcases/kernel/syscalls/setpriority/setpriority04.c
+++ b/testcases/kernel/syscalls/setpriority/setpriority04.c
@@ -95,7 +95,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -137,7 +141,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
diff --git a/testcases/kernel/syscalls/setpriority/setpriority05.c b/testcases/kernel/syscalls/setpriority/setpriority05.c
index 07d8d42..2580445 100644
--- a/testcases/kernel/syscalls/setpriority/setpriority05.c
+++ b/testcases/kernel/syscalls/setpriority/setpriority05.c
@@ -80,7 +80,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -120,7 +124,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
@@ -131,7 +135,7 @@
{
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/setregid/setregid01.c b/testcases/kernel/syscalls/setregid/setregid01.c
index f97809a..be0c0d9 100644
--- a/testcases/kernel/syscalls/setregid/setregid01.c
+++ b/testcases/kernel/syscalls/setregid/setregid01.c
@@ -134,23 +134,14 @@
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
- /***************************************************************
- * parse standard options
- ***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /***************************************************************
- * perform global setup for test
- ***************************************************************/
setup();
/* set the expected errnos... */
TEST_EXP_ENOS(exp_enos);
- /***************************************************************
- * check looping state if -c option given
- ***************************************************************/
for (lc = 0; TEST_LOOPING(lc); lc++) {
/* reset Tst_count in case we are looping. */
@@ -173,9 +164,6 @@
"setregid - Dont change either real or effective gid failed, errno=%d : %s",
TEST_ERRNO, strerror(TEST_ERRNO));
} else {
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
if (STD_FUNCTIONAL_TEST) {
/* No Verification test, yet... */
tst_resm(TPASS,
@@ -199,9 +187,6 @@
"setregid - change effective to effective gid failed, errno=%d : %s",
TEST_ERRNO, strerror(TEST_ERRNO));
} else {
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
if (STD_FUNCTIONAL_TEST) {
/* No Verification test, yet... */
tst_resm(TPASS,
@@ -225,9 +210,6 @@
"setregid - change real to real gid failed, errno=%d : %s",
TEST_ERRNO, strerror(TEST_ERRNO));
} else {
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
if (STD_FUNCTIONAL_TEST) {
/* No Verification test, yet... */
tst_resm(TPASS,
@@ -251,9 +233,6 @@
"setregid - change effective to real gid failed, errno=%d : %s",
TEST_ERRNO, strerror(TEST_ERRNO));
} else {
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
if (STD_FUNCTIONAL_TEST) {
/* No Verification test, yet... */
tst_resm(TPASS,
@@ -273,18 +252,12 @@
/* check return code */
if (TEST_RETURN == -1) {
TEST_ERROR_LOG(TEST_ERRNO);
- tst_resm(TFAIL,
- "setregid - try to change real to current real failed, errno=%d : %s",
- TEST_ERRNO, strerror(TEST_ERRNO));
+ tst_resm(TFAIL|TTERRNO, "setregid failed");
} else {
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
if (STD_FUNCTIONAL_TEST) {
/* No Verification test, yet... */
- tst_resm(TPASS,
- "setregid - try to change real to current real returned %ld",
- TEST_RETURN);
+ tst_resm(TPASS, "setregid return %ld",
+ TEST_RETURN);
}
}
diff --git a/testcases/kernel/syscalls/setregid/setregid02.c b/testcases/kernel/syscalls/setregid/setregid02.c
index d3b8691..b368f08 100644
--- a/testcases/kernel/syscalls/setregid/setregid02.c
+++ b/testcases/kernel/syscalls/setregid/setregid02.c
@@ -196,37 +196,42 @@
*/
void setup(void)
{
+ struct group *junk;
+
tst_require_root(NULL);
/* capture signals */
tst_sig(FORK, DEF_HANDLER, cleanup);
if ((nobody = getpwnam("nobody")) == NULL) {
- tst_brkm(TBROK, NULL, "nobody must be a valid user.");
+ tst_brkm(TBROK, NULL, "getpwnam(\"nobody\") failed");
}
if (setgid(nobody->pw_gid) == -1) {
- tst_resm(TINFO, "setgid failed to "
- "to set the effective gid to %d", nobody->pw_gid);
- perror("setgid");
+ tst_brkm(TBROK|TERRNO, NULL,
+ "setgid failed to set the effective gid to %d",
+ nobody->pw_gid);
}
if (setuid(nobody->pw_uid) == -1) {
- tst_resm(TINFO, "setuid failed to "
- "to set the effective uid to %d", nobody->pw_uid);
- perror("setuid");
+ tst_brkm(TBROK|TERRNO, NULL,
+ "setuid failed to to set the effective uid to %d",
+ nobody->pw_uid);
}
/* set the expected errnos... */
TEST_EXP_ENOS(exp_enos);
- root = *(getgrnam("root"));
- root_gr_gid = root.gr_gid;
+#define GET_GID(group) do { \
+ junk = getgrnam(#group); \
+ if (junk == NULL) { \
+ tst_brkm(TBROK|TERRNO, NULL, "getgrnam(\"%s\") failed", #group); \
+ } \
+ group ## _gr_gid = junk->gr_gid;\
+} while (0)
- users = *(getgrnam("users"));
- users_gr_gid = users.gr_gid;
-
- bin = *(getgrnam("bin"));
- bin_gr_gid = bin.gr_gid;
+ GET_GID(root);
+ GET_GID(users);
+ GET_GID(bin);
/* Pause if that option was specified
* TEST_PAUSE contains the code to fork the test with the -c option.
@@ -246,10 +251,7 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
- /*NOTREACHED*/}
+ }
void gid_verify(struct group *rg, struct group *eg, char *when)
{
diff --git a/testcases/kernel/syscalls/setregid/setregid03.c b/testcases/kernel/syscalls/setregid/setregid03.c
index 4996b8d..d6c51b9 100644
--- a/testcases/kernel/syscalls/setregid/setregid03.c
+++ b/testcases/kernel/syscalls/setregid/setregid03.c
@@ -141,7 +141,7 @@
/* set the appropriate ownership values */
if (setregid(sys_gr_gid, bin_gr_gid) == -1) {
tst_brkm(TBROK, NULL, "Initial setregid failed");
- /*NOTREACHED*/}
+ }
if (seteuid(nobody_pw_uid) == -1) {
tst_brkm(TBROK, NULL, "Initial seteuid failed");
diff --git a/testcases/kernel/syscalls/setregid/setregid04.c b/testcases/kernel/syscalls/setregid/setregid04.c
index 595dbcf..be55a67 100644
--- a/testcases/kernel/syscalls/setregid/setregid04.c
+++ b/testcases/kernel/syscalls/setregid/setregid04.c
@@ -133,9 +133,8 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/* Perform global setup for test */
setup();
diff --git a/testcases/kernel/syscalls/setresgid/setresgid01.c b/testcases/kernel/syscalls/setresgid/setresgid01.c
index e28984f..6a31f8f 100644
--- a/testcases/kernel/syscalls/setresgid/setresgid01.c
+++ b/testcases/kernel/syscalls/setresgid/setresgid01.c
@@ -163,7 +163,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
static int test_functionality(uid_t exp_rgid, uid_t exp_egid, uid_t exp_sgid)
@@ -203,19 +203,19 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Must be root for this test!");
- /*NOTREACHED*/}
+ tst_brkm(TBROK, NULL, "Must be root for this test!");
+ }
if ((passwd_p = getpwnam("root")) == NULL) {
- tst_brkm(TBROK, tst_exit, "getpwnam() failed for root");
- /* NOTREACHED */
+ tst_brkm(TBROK, NULL, "getpwnam() failed for root");
+
}
root = *passwd_p;
root_gid = root.pw_gid;
if ((passwd_p = getpwnam("nobody")) == NULL) {
- tst_brkm(TBROK, tst_exit, "nobody user id doesn't exist");
- /* NOTREACHED */
+ tst_brkm(TBROK, NULL, "nobody user id doesn't exist");
+
}
nobody = *passwd_p;
nobody_gid = nobody.pw_gid;
@@ -242,4 +242,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/setresgid/setresgid02.c b/testcases/kernel/syscalls/setresgid/setresgid02.c
index 0d9d89e..7828f2f 100644
--- a/testcases/kernel/syscalls/setresgid/setresgid02.c
+++ b/testcases/kernel/syscalls/setresgid/setresgid02.c
@@ -170,7 +170,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
static int test_functionality(uid_t exp_rgid, uid_t exp_egid, uid_t exp_sgid)
@@ -211,35 +211,35 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Must be root for this test!");
- /*NOTREACHED*/}
+ tst_brkm(TBROK, NULL, "Must be root for this test!");
+ }
if ((passwd_p = getpwnam("root")) == NULL) {
- tst_brkm(TBROK, tst_exit, "getpwnam() failed for root");
- /* NOTREACHED */
+ tst_brkm(TBROK, NULL, "getpwnam() failed for root");
+
}
root = *passwd_p;
root_gid = root.pw_gid;
if ((passwd_p = getpwnam("bin")) == NULL) {
- tst_brkm(TBROK, tst_exit, "bin user id doesn't exist");
- /* NOTREACHED */
+ tst_brkm(TBROK, NULL, "bin user id doesn't exist");
+
}
bin = *passwd_p;
bin_gid = bin.pw_gid;
if ((passwd_p = getpwnam("nobody")) == NULL) {
- tst_brkm(TBROK, tst_exit, "nobody user id doesn't exist");
- /* NOTREACHED */
+ tst_brkm(TBROK, NULL, "nobody user id doesn't exist");
+
}
nobody = *passwd_p;
nobody_gid = nobody.pw_gid;
/* Set effective/saved gid to nobody */
if (setresgid(-1, nobody_gid, nobody_gid) == -1) {
- tst_brkm(TBROK, tst_exit, "setup() failed for setting while"
+ tst_brkm(TBROK, NULL, "setup() failed for setting while"
" setting real/effective/saved gid");
- /* NOTREACHED */
+
}
/* Pause if that option was specified
@@ -264,4 +264,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/setresgid/setresgid03.c b/testcases/kernel/syscalls/setresgid/setresgid03.c
index 551278f..bdc8e25 100644
--- a/testcases/kernel/syscalls/setresgid/setresgid03.c
+++ b/testcases/kernel/syscalls/setresgid/setresgid03.c
@@ -169,7 +169,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
static int test_functionality(uid_t exp_rgid, uid_t exp_egid, uid_t exp_sgid)
@@ -209,25 +209,25 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Must be root for this test!");
- /*NOTREACHED*/}
+ tst_brkm(TBROK, NULL, "Must be root for this test!");
+ }
if ((passwd_p = getpwnam("root")) == NULL) {
- tst_brkm(TBROK, tst_exit, "getpwnam() failed for root");
- /* NOTREACHED */
+ tst_brkm(TBROK, NULL, "getpwnam() failed for root");
+
}
root = *passwd_p;
if ((passwd_p = getpwnam("bin")) == NULL) {
- tst_brkm(TBROK, tst_exit, "bin user id doesn't exist");
- /* NOTREACHED */
+ tst_brkm(TBROK, NULL, "bin user id doesn't exist");
+
}
bin = *passwd_p;
bin_gid = bin.pw_gid;
if ((passwd_p = getpwnam("nobody")) == NULL) {
- tst_brkm(TBROK, tst_exit, "nobody user id doesn't exist");
- /* NOTREACHED */
+ tst_brkm(TBROK, NULL, "nobody user id doesn't exist");
+
}
nobody = *passwd_p;
nobody_gid = nobody.pw_gid;
@@ -237,15 +237,15 @@
/* Set real/effective/saved gid to nobody */
if (setresgid(nobody_gid, nobody_gid, nobody_gid) == -1) {
- tst_brkm(TBROK, tst_exit, "setup() failed for setting while"
+ tst_brkm(TBROK, NULL, "setup() failed for setting while"
" setting real/effective/saved gid");
- /* NOTREACHED */
+
}
/* Set euid to nobody */
if (setuid(nobody.pw_uid) == -1) {
- tst_brkm(TBROK, tst_exit, "setuid failed to "
+ tst_brkm(TBROK, NULL, "setuid failed to "
"to set the effective uid to nodody");
- /* NOTREACHED */
+
}
/* Pause if that option was specified
* TEST_PAUSE contains the code to fork the test with the -c option.
@@ -269,4 +269,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/setresuid/setresuid01.c b/testcases/kernel/syscalls/setresuid/setresuid01.c
index bfb5b01..f8dea2f 100644
--- a/testcases/kernel/syscalls/setresuid/setresuid01.c
+++ b/testcases/kernel/syscalls/setresuid/setresuid01.c
@@ -131,7 +131,7 @@
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
/* Perform global setup for test */
setup();
@@ -172,7 +172,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
@@ -188,17 +188,17 @@
if (geteuid() != 0) {
tst_brkm(TBROK, NULL, "Must be root for this test!");
tst_exit();
- /*NOTREACHED*/}
+ }
if (getpwnam("nobody") == NULL) {
tst_brkm(TBROK, NULL, "nobody must be a valid user.");
tst_exit();
- /*NOTREACHED*/}
+ }
if (getpwnam("bin") == NULL) {
tst_brkm(TBROK, NULL, "bin must be a valid user.");
tst_exit();
- /*NOTREACHED*/}
+ }
/* set the expected errnos... */
TEST_EXP_ENOS(exp_enos);
@@ -233,7 +233,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
void
uid_verify(struct passwd *ru, struct passwd *eu, struct passwd *su, char *when)
@@ -241,7 +241,7 @@
uid_t cur_ru, cur_eu, cur_su;
if (getresuid(&cur_ru, &cur_eu, &cur_su) != 0) {
tst_brkm(TBROK, cleanup, "Set getresuid() failed");
- /*NOTREACHED*/}
+ }
if ((cur_ru != ru->pw_uid) || (cur_eu != eu->pw_uid) || (cur_su !=
su->pw_uid)) {
tst_resm(TFAIL, "ERROR: %s real uid = %d; effective uid = %d; "
diff --git a/testcases/kernel/syscalls/setresuid/setresuid02.c b/testcases/kernel/syscalls/setresuid/setresuid02.c
index db138ca..9866deb 100644
--- a/testcases/kernel/syscalls/setresuid/setresuid02.c
+++ b/testcases/kernel/syscalls/setresuid/setresuid02.c
@@ -120,7 +120,7 @@
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
/* Perform global setup for test */
setup();
@@ -135,11 +135,11 @@
/* set the appropriate ownership values */
if (setresuid(nobody_pw_uid, bin_pw_uid, nobody_pw_uid) == -1) {
tst_brkm(TFAIL, cleanup, "Initial setresuid failed");
- /*NOTREACHED*/}
+ }
if ((pid = FORK_OR_VFORK()) == -1) {
tst_brkm(TBROK, cleanup, "fork failed");
- /*NOTREACHED*/} else if (pid == 0) { /* child */
+ } else if (pid == 0) { /* child */
for (i = 0; i < TST_TOTAL; i++) {
@@ -186,7 +186,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
@@ -201,12 +201,12 @@
if (getpwnam("nobody") == NULL) {
tst_brkm(TBROK, NULL, "nobody must be a valid user.");
tst_exit();
- /*NOTREACHED*/}
+ }
if (getpwnam("bin") == NULL) {
tst_brkm(TBROK, NULL, "bin must be a valid user.");
tst_exit();
- /*NOTREACHED*/}
+ }
/* Check that the test process id is root */
if (geteuid() != 0) {
@@ -243,7 +243,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
void
uid_verify(struct passwd *ru, struct passwd *eu, struct passwd *su, char *when)
@@ -252,7 +252,7 @@
if (getresuid(&cur_ru, &cur_eu, &cur_su) != 0) {
flag = -1;
tst_brkm(TBROK, cleanup, "Set getresuid() failed");
- /*NOTREACHED*/}
+ }
if ((cur_ru != ru->pw_uid) || (cur_eu != eu->pw_uid) || (cur_su !=
su->pw_uid)) {
tst_resm(TFAIL, "ERROR: %s real uid = %d; effective uid = %d; "
diff --git a/testcases/kernel/syscalls/setresuid/setresuid03.c b/testcases/kernel/syscalls/setresuid/setresuid03.c
index 38d4f9c..f13780e 100644
--- a/testcases/kernel/syscalls/setresuid/setresuid03.c
+++ b/testcases/kernel/syscalls/setresuid/setresuid03.c
@@ -131,7 +131,7 @@
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
/* Perform global setup for test */
setup();
@@ -147,11 +147,11 @@
if (setresuid(root_pw_uid, bin_pw_uid, bin_pw_uid)
== -1) {
tst_brkm(TFAIL, cleanup, "Initial setresuid failed");
- /*NOTREACHED*/}
+ }
if ((pid = FORK_OR_VFORK()) == -1) {
tst_brkm(TBROK, cleanup, "fork failed");
- /*NOTREACHED*/} else if (pid == 0) { /* child */
+ } else if (pid == 0) { /* child */
for (i = 0; i < TST_TOTAL; i++) {
@@ -199,7 +199,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
@@ -214,18 +214,18 @@
if (getpwnam("nobody") == NULL) {
tst_brkm(TBROK, NULL, "nobody must be a valid user.");
tst_exit();
- /*NOTREACHED*/}
+ }
if (getpwnam("bin") == NULL) {
tst_brkm(TBROK, NULL, "bin must be a valid user.");
tst_exit();
- /*NOTREACHED*/}
+ }
/* Check that the test process id is root */
if (geteuid() != 0) {
tst_brkm(TBROK, NULL, "Must be root for this test!");
tst_exit();
- /*NOTREACHED*/}
+ }
root = *(getpwnam("root"));
root_pw_uid = root.pw_uid;
@@ -259,7 +259,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
void
uid_verify(struct passwd *ru, struct passwd *eu, struct passwd *su, char *when)
@@ -268,7 +268,7 @@
if (getresuid(&cur_ru, &cur_eu, &cur_su) != 0) {
flag = -1;
tst_brkm(TBROK, cleanup, "Set getresuid() failed");
- /*NOTREACHED*/}
+ }
if ((cur_ru != ru->pw_uid) || (cur_eu != eu->pw_uid) || (cur_su !=
su->pw_uid)) {
tst_resm(TFAIL, "ERROR: %s real uid = %d; effective uid = %d; "
diff --git a/testcases/kernel/syscalls/setresuid/setresuid04.c b/testcases/kernel/syscalls/setresuid/setresuid04.c
index 23a11ac..9b0bac4 100644
--- a/testcases/kernel/syscalls/setresuid/setresuid04.c
+++ b/testcases/kernel/syscalls/setresuid/setresuid04.c
@@ -76,8 +76,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
/*
* perform global setup for the test
@@ -101,7 +105,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -207,7 +211,7 @@
void setup(void)
{
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
diff --git a/testcases/kernel/syscalls/setreuid/setreuid01.c b/testcases/kernel/syscalls/setreuid/setreuid01.c
index 93eea59..a75f9fd 100644
--- a/testcases/kernel/syscalls/setreuid/setreuid01.c
+++ b/testcases/kernel/syscalls/setreuid/setreuid01.c
@@ -138,7 +138,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/setreuid/setreuid02.c b/testcases/kernel/syscalls/setreuid/setreuid02.c
index 8d0982b..c7b263d 100644
--- a/testcases/kernel/syscalls/setreuid/setreuid02.c
+++ b/testcases/kernel/syscalls/setreuid/setreuid02.c
@@ -116,7 +116,7 @@
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
/* Perform global setup for test */
setup();
@@ -154,7 +154,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
@@ -170,12 +170,12 @@
if (getpwnam("nobody") == NULL) {
tst_brkm(TBROK, NULL, "nobody must be a valid user.");
tst_exit();
- /*NOTREACHED*/}
+ }
if (getpwnam("daemon") == NULL) {
tst_brkm(TBROK, NULL, "daemon must be a valid user.");
tst_exit();
- /*NOTREACHED*/}
+ }
/* Check that the test process id is root */
if (geteuid() != 0) {
@@ -219,7 +219,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
void uid_verify(struct passwd *ru, struct passwd *eu, char *when)
{
diff --git a/testcases/kernel/syscalls/setreuid/setreuid03.c b/testcases/kernel/syscalls/setreuid/setreuid03.c
index af40f89..07162c5 100644
--- a/testcases/kernel/syscalls/setreuid/setreuid03.c
+++ b/testcases/kernel/syscalls/setreuid/setreuid03.c
@@ -142,7 +142,7 @@
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
/* Perform global setup for test */
setup();
@@ -204,7 +204,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
@@ -220,12 +220,12 @@
if (getpwnam("nobody") == NULL) {
tst_brkm(TBROK, NULL, "nobody must be a valid user.");
tst_exit();
- /*NOTREACHED*/}
+ }
if (getpwnam("bin") == NULL) {
tst_brkm(TBROK, NULL, "bin must be a valid user.");
tst_exit();
- /*NOTREACHED*/}
+ }
/* set the expected errnos... */
TEST_EXP_ENOS(exp_enos);
@@ -267,7 +267,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
void uid_verify(struct passwd *ru, struct passwd *eu, char *when)
{
diff --git a/testcases/kernel/syscalls/setreuid/setreuid04.c b/testcases/kernel/syscalls/setreuid/setreuid04.c
index 65c1a5f..587ff77 100644
--- a/testcases/kernel/syscalls/setreuid/setreuid04.c
+++ b/testcases/kernel/syscalls/setreuid/setreuid04.c
@@ -113,7 +113,7 @@
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
/* Perform global setup for test */
setup();
@@ -127,7 +127,7 @@
if ((pid = FORK_OR_VFORK()) == -1) {
tst_brkm(TBROK, cleanup, "fork failed");
- /*NOTREACHED*/} else if (pid == 0) { /* child */
+ } else if (pid == 0) { /* child */
for (i = 0; i < TST_TOTAL; i++) {
@@ -170,7 +170,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
@@ -186,7 +186,7 @@
if (getpwnam("nobody") == NULL) {
tst_brkm(TBROK, NULL, "nobody must be a valid user.");
tst_exit();
- /*NOTREACHED*/}
+ }
/* Check that the test process id is root */
if (geteuid() != 0) {
@@ -223,7 +223,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
void uid_verify(struct passwd *ru, struct passwd *eu, char *when)
{
diff --git a/testcases/kernel/syscalls/setreuid/setreuid05.c b/testcases/kernel/syscalls/setreuid/setreuid05.c
index e12e8ef..4dc5fef 100644
--- a/testcases/kernel/syscalls/setreuid/setreuid05.c
+++ b/testcases/kernel/syscalls/setreuid/setreuid05.c
@@ -141,7 +141,7 @@
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
/* Perform global setup for test */
setup();
@@ -155,7 +155,7 @@
if ((pid = FORK_OR_VFORK()) == -1) {
tst_brkm(TBROK, cleanup, "fork failed");
- /*NOTREACHED*/} else if (pid == 0) { /* child */
+ } else if (pid == 0) { /* child */
for (i = 0; i < TST_TOTAL; i++) {
/* Set the real or effective user id */
TEST(setreuid(*test_data[i].real_uid,
@@ -218,7 +218,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
@@ -234,17 +234,17 @@
if (getpwnam("nobody") == NULL) {
tst_brkm(TBROK, NULL, "nobody must be a valid user.");
tst_exit();
- /*NOTREACHED*/}
+ }
if (getpwnam("daemon") == NULL) {
tst_brkm(TBROK, NULL, "daemon must be a valid user.");
tst_exit();
- /*NOTREACHED*/}
+ }
if (getuid() != 0) {
tst_resm(TBROK, "Must be run as root");
tst_exit();
- /*NOTREACHED*/}
+ }
/* set the expected errnos... */
TEST_EXP_ENOS(exp_enos);
@@ -282,7 +282,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
void uid_verify(struct passwd *ru, struct passwd *eu, char *when)
{
diff --git a/testcases/kernel/syscalls/setreuid/setreuid06.c b/testcases/kernel/syscalls/setreuid/setreuid06.c
index 2e66738..f6af207 100644
--- a/testcases/kernel/syscalls/setreuid/setreuid06.c
+++ b/testcases/kernel/syscalls/setreuid/setreuid06.c
@@ -76,7 +76,7 @@
if ((msg = parse_opts(argc, argv, NULL, NULL)) !=
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+ }
/*
* perform global setup for the test
@@ -103,7 +103,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
@@ -123,7 +123,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/setreuid/setreuid07.c b/testcases/kernel/syscalls/setreuid/setreuid07.c
index f220ba0..fafb833 100644
--- a/testcases/kernel/syscalls/setreuid/setreuid07.c
+++ b/testcases/kernel/syscalls/setreuid/setreuid07.c
@@ -75,8 +75,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
/*
* perform global setup for the test
@@ -100,7 +104,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -206,7 +210,7 @@
void setup(void)
{
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
diff --git a/testcases/kernel/syscalls/setrlimit/setrlimit01.c b/testcases/kernel/syscalls/setrlimit/setrlimit01.c
index 37e9f84..6cc29f9 100644
--- a/testcases/kernel/syscalls/setrlimit/setrlimit01.c
+++ b/testcases/kernel/syscalls/setrlimit/setrlimit01.c
@@ -82,8 +82,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup(); /* set "tstdir", and "fname" vars */
@@ -105,7 +109,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
@@ -343,7 +347,7 @@
{
/* must run test as root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Must run test as root");
+ tst_brkm(TBROK, NULL, "Must run test as root");
}
umask(0);
diff --git a/testcases/kernel/syscalls/setrlimit/setrlimit02.c b/testcases/kernel/syscalls/setrlimit/setrlimit02.c
index 753eaa0..12c08c0 100644
--- a/testcases/kernel/syscalls/setrlimit/setrlimit02.c
+++ b/testcases/kernel/syscalls/setrlimit/setrlimit02.c
@@ -88,8 +88,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup();
@@ -127,7 +131,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
@@ -145,7 +149,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/setrlimit/setrlimit03.c b/testcases/kernel/syscalls/setrlimit/setrlimit03.c
index 498dd78..41928ff 100644
--- a/testcases/kernel/syscalls/setrlimit/setrlimit03.c
+++ b/testcases/kernel/syscalls/setrlimit/setrlimit03.c
@@ -70,8 +70,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup();
@@ -105,7 +109,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -115,7 +119,7 @@
{
/* must run test as root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "must run test as root");
+ tst_brkm(TBROK, NULL, "must run test as root");
}
/* capture signals */
diff --git a/testcases/kernel/syscalls/setsid/setsid01.c b/testcases/kernel/syscalls/setsid/setsid01.c
index 1232214..840a990 100644
--- a/testcases/kernel/syscalls/setsid/setsid01.c
+++ b/testcases/kernel/syscalls/setsid/setsid01.c
@@ -71,9 +71,8 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
#ifdef UCLINUX
argv0 = av[0];
@@ -148,7 +147,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
diff --git a/testcases/kernel/syscalls/setsockopt/setsockopt01.c b/testcases/kernel/syscalls/setsockopt/setsockopt01.c
index bd066a0..872c211 100644
--- a/testcases/kernel/syscalls/setsockopt/setsockopt01.c
+++ b/testcases/kernel/syscalls/setsockopt/setsockopt01.c
@@ -138,11 +138,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
setup();
/* Check looping state if -i option given */
@@ -176,7 +180,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
void setup(void)
diff --git a/testcases/kernel/syscalls/settimeofday/settimeofday01.c b/testcases/kernel/syscalls/settimeofday/settimeofday01.c
index 415b789..8e1da9f 100644
--- a/testcases/kernel/syscalls/settimeofday/settimeofday01.c
+++ b/testcases/kernel/syscalls/settimeofday/settimeofday01.c
@@ -89,7 +89,7 @@
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
setup();
@@ -144,7 +144,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
@@ -171,7 +171,7 @@
if (geteuid() != 0) {
tst_brkm(TBROK, NULL, "Must be root for this test!");
tst_exit();
- /*NOTREACHED*/}
+ }
/* set the expected errnos... */
TEST_EXP_ENOS(exp_enos);
@@ -185,7 +185,7 @@
if ((gettimeofday(&tp, (struct timezone *)&tp1)) == -1) {
tst_brkm(TBROK, cleanup, "gettimeofday failed. "
"errno=%d", errno);
- /*NOTREACHED*/}
+ }
save_tv_sec = tp.tv_sec;
save_tv_usec = tp.tv_usec;
}
@@ -213,4 +213,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/settimeofday/settimeofday02.c b/testcases/kernel/syscalls/settimeofday/settimeofday02.c
index 4242fa5..4bee4a3 100644
--- a/testcases/kernel/syscalls/settimeofday/settimeofday02.c
+++ b/testcases/kernel/syscalls/settimeofday/settimeofday02.c
@@ -132,7 +132,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
@@ -159,7 +159,7 @@
if (geteuid() != 0) {
tst_brkm(TBROK, NULL, "Must be root for this test!");
tst_exit();
- /*NOTREACHED*/}
+ }
/* Switch to nobody user for correct error code collection */
ltpuser = getpwnam(nobody_uid);
@@ -181,7 +181,7 @@
if ((gettimeofday(&tp, (struct timezone *)&tp)) == -1) {
tst_brkm(TBROK, cleanup, "gettimeofday failed. "
"errno=%d", errno);
- /*NOTREACHED*/}
+ }
save_tv_sec = tp.tv_sec;
save_tv_usec = tp.tv_usec;
}
@@ -201,7 +201,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
void restore_time(void)
{
diff --git a/testcases/kernel/syscalls/setuid/setuid02.c b/testcases/kernel/syscalls/setuid/setuid02.c
index c100c70..558e12f 100644
--- a/testcases/kernel/syscalls/setuid/setuid02.c
+++ b/testcases/kernel/syscalls/setuid/setuid02.c
@@ -138,7 +138,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/setuid/setuid03.c b/testcases/kernel/syscalls/setuid/setuid03.c
index 4ac97c8..3cda4be 100644
--- a/testcases/kernel/syscalls/setuid/setuid03.c
+++ b/testcases/kernel/syscalls/setuid/setuid03.c
@@ -67,8 +67,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
/*
* perform global setup for the test
@@ -101,7 +105,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -111,7 +115,7 @@
{
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/setuid/setuid04.c b/testcases/kernel/syscalls/setuid/setuid04.c
index 0d1cfdd..92c502f 100644
--- a/testcases/kernel/syscalls/setuid/setuid04.c
+++ b/testcases/kernel/syscalls/setuid/setuid04.c
@@ -77,8 +77,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
/*
* perform global setup for the test
@@ -101,7 +105,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -114,7 +118,7 @@
int status;
if (setuid(ltpuser->pw_uid) == -1) {
- tst_brkm(TBROK, tst_exit,
+ tst_brkm(TBROK, NULL,
"setuid failed to set the effective uid to %d",
ltpuser->pw_uid);
}
@@ -143,7 +147,7 @@
pid = FORK_OR_VFORK();
if (pid < 0)
- tst_brkm(TBROK, tst_exit, "Fork failed");
+ tst_brkm(TBROK, NULL, "Fork failed");
if (pid == 0) {
int tst_fd2;
@@ -182,7 +186,7 @@
void setup(void)
{
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
diff --git a/testcases/kernel/syscalls/sgetmask/sgetmask01.c b/testcases/kernel/syscalls/sgetmask/sgetmask01.c
index 3183e30..9e2263a 100644
--- a/testcases/kernel/syscalls/sgetmask/sgetmask01.c
+++ b/testcases/kernel/syscalls/sgetmask/sgetmask01.c
@@ -127,7 +127,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
tst_exit();
}
diff --git a/testcases/kernel/syscalls/sigaction/sigaction01.c b/testcases/kernel/syscalls/sigaction/sigaction01.c
index 31b271a..9de1b2e 100644
--- a/testcases/kernel/syscalls/sigaction/sigaction01.c
+++ b/testcases/kernel/syscalls/sigaction/sigaction01.c
@@ -243,7 +243,11 @@
};
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -284,5 +288,5 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
diff --git a/testcases/kernel/syscalls/sigaction/sigaction02.c b/testcases/kernel/syscalls/sigaction/sigaction02.c
index ba05d06..618e010 100644
--- a/testcases/kernel/syscalls/sigaction/sigaction02.c
+++ b/testcases/kernel/syscalls/sigaction/sigaction02.c
@@ -117,7 +117,11 @@
int ret;
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
//test1:
testcase_no = 1;
diff --git a/testcases/kernel/syscalls/sigaltstack/sigaltstack01.c b/testcases/kernel/syscalls/sigaltstack/sigaltstack01.c
index d54f245..e5263a2 100644
--- a/testcases/kernel/syscalls/sigaltstack/sigaltstack01.c
+++ b/testcases/kernel/syscalls/sigaltstack/sigaltstack01.c
@@ -100,11 +100,15 @@
void *alt_stk; /* address of alternate stack for signal */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
/* Perform global setup for test */
setup();
@@ -187,7 +191,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
@@ -215,7 +219,7 @@
if ((sigaction(SIGUSR1, &act, &oact)) == -1) {
tst_brkm(TFAIL, cleanup,
"sigaction() fails in setup, errno=%d", errno);
- /*NOTREACHED*/}
+ }
/* Send the signal to the test process */
kill(my_pid, SIGUSR1);
@@ -230,7 +234,7 @@
if ((sigstk.ss_sp = (void *)malloc(SIGSTKSZ)) == NULL) {
tst_brkm(TFAIL, cleanup,
"could not allocate memory for the alternate stack");
- /*NOTREACHED*/}
+ }
}
/*
diff --git a/testcases/kernel/syscalls/sigaltstack/sigaltstack02.c b/testcases/kernel/syscalls/sigaltstack/sigaltstack02.c
index 145976a..ad94e26 100644
--- a/testcases/kernel/syscalls/sigaltstack/sigaltstack02.c
+++ b/testcases/kernel/syscalls/sigaltstack/sigaltstack02.c
@@ -119,11 +119,15 @@
int ind; /* counter to test different test conditions */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
/* Perform global setup for test */
setup();
@@ -180,7 +184,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
@@ -201,7 +205,7 @@
if ((sigstk.ss_sp = (void *)malloc(SIGSTKSZ)) == NULL) {
tst_brkm(TFAIL, cleanup,
"could not allocate memory for the alternate stack");
- /*NOTREACHED*/}
+ }
}
/*
diff --git a/testcases/kernel/syscalls/signal/signal02.c b/testcases/kernel/syscalls/signal/signal02.c
index 87edded..2ef48fb 100644
--- a/testcases/kernel/syscalls/signal/signal02.c
+++ b/testcases/kernel/syscalls/signal/signal02.c
@@ -80,8 +80,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup(); /* global setup */
@@ -104,7 +108,7 @@
tst_brkm(TFAIL, cleanup, "%s call failed - "
"errno = %d : %s", TCID, TEST_ERRNO,
strerror(TEST_ERRNO));
- /*NOTREACHED*/}
+ }
TEST_ERROR_LOG(TEST_ERRNO);
@@ -126,7 +130,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
diff --git a/testcases/kernel/syscalls/signal/signal03.c b/testcases/kernel/syscalls/signal/signal03.c
index 55c334d..6569260 100644
--- a/testcases/kernel/syscalls/signal/signal03.c
+++ b/testcases/kernel/syscalls/signal/signal03.c
@@ -98,8 +98,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup(); /* global setup */
@@ -122,7 +126,7 @@
tst_brkm(TFAIL, cleanup, "%s call failed - "
"errno = %d : %s", TCID,
TEST_ERRNO, strerror(TEST_ERRNO));
- /*NOTREACHED*/}
+ }
if (STD_FUNCTIONAL_TEST) {
/*
@@ -135,7 +139,7 @@
if ((rval = kill(pid, siglist[i])) != 0) {
tst_brkm(TBROK, cleanup, "call to "
"kill failed");
- /*NOTREACHED*/}
+ }
if (fail == 0) {
tst_resm(TPASS, "%s call succeeded",
@@ -153,7 +157,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
diff --git a/testcases/kernel/syscalls/signal/signal04.c b/testcases/kernel/syscalls/signal/signal04.c
index 67ab344..587c11f 100644
--- a/testcases/kernel/syscalls/signal/signal04.c
+++ b/testcases/kernel/syscalls/signal/signal04.c
@@ -92,8 +92,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup(); /* global setup */
@@ -117,7 +121,7 @@
if ((rval = signal(siglist[i], &sighandler)) == SIG_ERR) {
tst_brkm(TBROK, cleanup, "initial signal call"
" failed");
- /*NOTREACHED*/}
+ }
/* store the return value */
first = rval;
@@ -131,7 +135,7 @@
tst_brkm(TFAIL, cleanup, "%s call failed - "
"errno = %d : %s", TCID, TEST_ERRNO,
strerror(TEST_ERRNO));
- /*NOTREACHED*/}
+ }
if (STD_FUNCTIONAL_TEST) {
/* now set the handler back to our own */
@@ -139,7 +143,7 @@
== SIG_ERR) {
tst_brkm(TBROK, cleanup, "initial "
"signal call failed");
- /*NOTREACHED*/}
+ }
/*
* the first return value should equal the
@@ -153,7 +157,7 @@
"values for signal(%d) don't "
"match. Got %p, expected %p.",
siglist[i], rval, first);
- /*NOTREACHED*/}
+ }
} else {
tst_resm(TPASS, "Call of signal(%d) succeeded",
siglist[i]);
@@ -162,7 +166,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
diff --git a/testcases/kernel/syscalls/signal/signal05.c b/testcases/kernel/syscalls/signal/signal05.c
index 3f525c6..ed15347 100644
--- a/testcases/kernel/syscalls/signal/signal05.c
+++ b/testcases/kernel/syscalls/signal/signal05.c
@@ -97,8 +97,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup(); /* global setup */
@@ -134,7 +138,7 @@
if ((rval = kill(pid, siglist[i])) != 0) {
tst_brkm(TBROK, cleanup,
"call to kill failed");
- /*NOTREACHED*/}
+ }
if (siglist[i] == pass) {
tst_resm(TPASS,
@@ -151,7 +155,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
diff --git a/testcases/kernel/syscalls/signalfd4/signalfd4_01.c b/testcases/kernel/syscalls/signalfd4/signalfd4_01.c
index 2ea8e78..9846a8f 100644
--- a/testcases/kernel/syscalls/signalfd4/signalfd4_01.c
+++ b/testcases/kernel/syscalls/signalfd4/signalfd4_01.c
@@ -144,7 +144,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
diff --git a/testcases/kernel/syscalls/signalfd4/signalfd4_02.c b/testcases/kernel/syscalls/signalfd4/signalfd4_02.c
index 08e30b1..3f55209 100644
--- a/testcases/kernel/syscalls/signalfd4/signalfd4_02.c
+++ b/testcases/kernel/syscalls/signalfd4/signalfd4_02.c
@@ -136,7 +136,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
diff --git a/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c b/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
index dfb26d6..d91bb5a 100644
--- a/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
+++ b/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
@@ -103,7 +103,11 @@
pid_t my_pid; /* test process id */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -175,7 +179,7 @@
tst_brkm(TFAIL, cleanup,
"sigismember() failed, "
"error:%d", errno);
- /*NOTREACHED*/}
+ }
/*
* Invoke sigprocmask() again to
@@ -190,7 +194,7 @@
"sigprocmask() failed "
"to unblock signal, "
"error=%d", errno);
- /*NOTREACHED*/}
+ }
if (sig_catch) {
tst_resm(TPASS, "Functionality "
"of sigprocmask() "
@@ -213,7 +217,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
@@ -242,12 +246,12 @@
tst_brkm(TFAIL, cleanup,
"sigemptyset() failed, errno=%d : %s",
errno, strerror(errno));
- /*NOTREACHED*/}
+ }
if (sigfillset(&sigset2) == -1) {
tst_brkm(TFAIL, cleanup,
"sigfillset() failed, errno=%d : %s",
errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/* Set the signal handler function to catch the signal */
sa_new.sa_handler = sig_handler;
@@ -255,7 +259,7 @@
tst_brkm(TFAIL, cleanup,
"sigaction() failed, errno=%d : %s",
errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/*
* Add specified signal (SIGINT) to the signal set
@@ -265,7 +269,7 @@
tst_brkm(TFAIL, cleanup,
"sigaddset() failed, errno=%d : %s",
errno, strerror(errno));
- /*NOTREACHED*/}
+ }
} /* End setup() */
/*
diff --git a/testcases/kernel/syscalls/sigsuspend/sigsuspend01.c b/testcases/kernel/syscalls/sigsuspend/sigsuspend01.c
index 1fd7a80..37c4380 100644
--- a/testcases/kernel/syscalls/sigsuspend/sigsuspend01.c
+++ b/testcases/kernel/syscalls/sigsuspend/sigsuspend01.c
@@ -194,12 +194,12 @@
tst_brkm(TFAIL, cleanup,
"sigemptyset() failed, errno=%d : %s",
errno, strerror(errno));
- /*NOTREACHED*/}
+ }
if (sigfillset(&sigset2) == -1) {
tst_brkm(TFAIL, cleanup,
"sigfillset() failed, errno=%d : %s",
errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/* Set the signal handler function to catch the signal */
sa_new.sa_handler = sig_handler;
@@ -207,14 +207,14 @@
tst_brkm(TFAIL, cleanup,
"sigaction() failed, errno=%d : %s",
errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/* Read the test process's current signal mask. */
if (sigprocmask(SIG_UNBLOCK, 0, &sigset1) == -1) {
tst_brkm(TFAIL, cleanup,
"sigprocmask() Failed, errno=%d : %s",
errno, strerror(errno));
- /*NOTREACHED*/}
+ }
} /* End setup() */
/*
diff --git a/testcases/kernel/syscalls/socket/socket01.c b/testcases/kernel/syscalls/socket/socket01.c
index f4a37bf..31ebb93 100644
--- a/testcases/kernel/syscalls/socket/socket01.c
+++ b/testcases/kernel/syscalls/socket/socket01.c
@@ -91,7 +91,11 @@
int s;
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -124,7 +128,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
diff --git a/testcases/kernel/syscalls/socket/socket02.c b/testcases/kernel/syscalls/socket/socket02.c
index 73af694..beee010 100644
--- a/testcases/kernel/syscalls/socket/socket02.c
+++ b/testcases/kernel/syscalls/socket/socket02.c
@@ -147,7 +147,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
diff --git a/testcases/kernel/syscalls/socket/socket03.c b/testcases/kernel/syscalls/socket/socket03.c
index ca2ee46..839397f 100644
--- a/testcases/kernel/syscalls/socket/socket03.c
+++ b/testcases/kernel/syscalls/socket/socket03.c
@@ -131,7 +131,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
diff --git a/testcases/kernel/syscalls/socketcall/socketcall02.c b/testcases/kernel/syscalls/socketcall/socketcall02.c
index 15ea122..6d4fd0a 100644
--- a/testcases/kernel/syscalls/socketcall/socketcall02.c
+++ b/testcases/kernel/syscalls/socketcall/socketcall02.c
@@ -131,7 +131,7 @@
tst_resm(TPASS, "socketcall() failed"
" as expected for %s", TC.desc);
} else {
- tst_brkm(TFAIL, tst_exit, "socketcall()"
+ tst_brkm(TFAIL, NULL, "socketcall()"
" Failed with wrong experrno"
" =%d got: errno=%d : %s",
TC.experrno, TEST_ERRNO, strerror(TEST_ERRNO));
diff --git a/testcases/kernel/syscalls/socketcall/socketcall03.c b/testcases/kernel/syscalls/socketcall/socketcall03.c
index 6caec41..d4f84c1 100644
--- a/testcases/kernel/syscalls/socketcall/socketcall03.c
+++ b/testcases/kernel/syscalls/socketcall/socketcall03.c
@@ -153,7 +153,7 @@
si.sin_port = 0;
if ((s = socket(TC.domain, TC.type, TC.pro)) == -1) {
- tst_brkm(TBROK, tst_exit, "socket creation failed");
+ tst_brkm(TBROK, NULL, "socket creation failed");
}
args[0] = s;
args[1] = (unsigned long)&si;
diff --git a/testcases/kernel/syscalls/socketcall/socketcall04.c b/testcases/kernel/syscalls/socketcall/socketcall04.c
index 44dd305..c1091fd 100644
--- a/testcases/kernel/syscalls/socketcall/socketcall04.c
+++ b/testcases/kernel/syscalls/socketcall/socketcall04.c
@@ -147,7 +147,7 @@
void setup1(void)
{
if ((s = socket(TC.domain, TC.type, TC.pro)) == -1) {
- tst_brkm(TBROK, tst_exit, "socket creation failed");
+ tst_brkm(TBROK, NULL, "socket creation failed");
}
args[0] = s;
args[1] = 1;
diff --git a/testcases/kernel/syscalls/socketpair/socketpair01.c b/testcases/kernel/syscalls/socketpair/socketpair01.c
index ab64e41..84aedc4 100644
--- a/testcases/kernel/syscalls/socketpair/socketpair01.c
+++ b/testcases/kernel/syscalls/socketpair/socketpair01.c
@@ -99,12 +99,8 @@
char *msg; /* message returned from parse_opts */
int s;
- /* Parse standard options given to run the test. */
- msg = parse_opts(argc, argv, NULL, NULL);
- if (msg != NULL) {
+ if ((msg = parse_opts(argc, argv, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
setup();
@@ -141,8 +137,7 @@
cleanup();
- return 0;
-
+ tst_exit();
} /* End main */
void setup(void)
@@ -156,5 +151,4 @@
void cleanup(void)
{
TEST_CLEANUP;
- tst_exit();
}
diff --git a/testcases/kernel/syscalls/socketpair/socketpair02.c b/testcases/kernel/syscalls/socketpair/socketpair02.c
index e8232ef..3f661b2 100644
--- a/testcases/kernel/syscalls/socketpair/socketpair02.c
+++ b/testcases/kernel/syscalls/socketpair/socketpair02.c
@@ -67,8 +67,6 @@
/* Global Variables */
char *TCID = "socketpair02"; /* test program identifier. */
-int testno;
-int TST_TOTAL = 1; /* total number of tests in this file. */
/* Extern Global Functions */
/******************************************************************************/
@@ -88,14 +86,11 @@
/* On success - Exits calling tst_exit(). With '0' return code. */
/* */
/******************************************************************************/
-extern void cleanup()
+void cleanup()
{
/* Remove tmp dir and all files in it */
TEST_CLEANUP;
tst_rmdir();
-
- /* Exit with appropriate return code. */
- tst_exit();
}
/* Local Functions */
@@ -127,75 +122,46 @@
int main(int argc, char *argv[])
{
int fds[2], fl, i;
- int lc; /* loop counter */
- char *msg; /* message returned from parse_opts */
- /* Parse standard options given to run the test. */
- msg = parse_opts(argc, argv, NULL, NULL);
- if (msg != NULL) {
- tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
if ((tst_kvercmp(2, 6, 27)) < 0) {
- tst_resm(TCONF,
- "This test can only run on kernels that are 2.6.27 and higher");
- tst_exit();
+ tst_brkm(TCONF, NULL,
+ "This test can only run on kernels that are 2.6.27 and higher");
}
setup();
/* Check looping state if -i option given */
- for (lc = 0; TEST_LOOPING(lc); ++lc) {
- Tst_count = 0;
- for (testno = 0; testno < TST_TOTAL; ++testno) {
- if (socketpair(PF_UNIX, SOCK_STREAM, 0, fds) == -1) {
- tst_resm(TFAIL, "socketpair(0) failed");
- cleanup();
- tst_exit();
- }
- for (i = 0; i < 2; ++i) {
- fl = fcntl(fds[i], F_GETFL);
- if (fl == -1) {
- tst_brkm(TBROK, cleanup,
- "fcntl failed");
- tst_exit();
- }
- if (fl & O_NONBLOCK) {
- tst_resm(TFAIL,
- "socketpair(0) set non-blocking mode for fds[%d]",
- i);
- cleanup();
- tst_exit();
- }
- close(fds[i]);
- }
-
- if (socketpair
- (PF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0,
- fds) == -1) {
- tst_resm(TFAIL,
- "socketpair(SOCK_NONBLOCK) failed");
- cleanup();
- tst_exit();
- }
- for (i = 0; i < 2; ++i) {
- fl = fcntl(fds[i], F_GETFL);
- if (fl == -1) {
- tst_brkm(TBROK, cleanup,
- "fcntl failed");
- tst_exit();
- }
- if ((fl & O_NONBLOCK) == 0) {
- tst_resm(TFAIL,
- "socketpair(SOCK_NONBLOCK) does not set non-blocking mode for fds[%d]",
- i);
- cleanup();
- tst_exit();
- }
- close(fds[i]);
- }
- tst_resm(TPASS, "socketpair(SOCK_NONBLOCK) PASSED");
- cleanup();
- }
+ if (socketpair(PF_UNIX, SOCK_STREAM, 0, fds) == -1) {
+ tst_brkm(TFAIL, cleanup, "socketpair(0) failed");
}
+ for (i = 0; i < (sizeof(fds) / sizeof(fds[0])); i++) {
+ fl = fcntl(fds[i], F_GETFL);
+ if (fl == -1) {
+ tst_brkm(TBROK, cleanup, "fcntl failed");
+ }
+ if (fl & O_NONBLOCK) {
+ tst_brkm(TFAIL, cleanup,
+ "socketpair(0) set non-blocking mode for fds[%d]",
+ i);
+ }
+ close(fds[i]);
+ }
+
+ if (socketpair(PF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0, fds) == -1) {
+ tst_brkm(TFAIL, cleanup, "socketpair(SOCK_NONBLOCK) failed");
+ }
+ for (i = 0; i < (sizeof(fds) / sizeof(fds[0])); i++) {
+ fl = fcntl(fds[i], F_GETFL);
+ if (fl == -1) {
+ tst_brkm(TBROK, cleanup, "fcntl failed");
+ }
+ if ((fl & O_NONBLOCK) == 0) {
+ tst_brkm(TFAIL, cleanup,
+ "socketpair(SOCK_NONBLOCK) didn't set non-blocking "
+ "mode for fds[%d]", i);
+ }
+ close(fds[i]);
+ }
+ tst_resm(TPASS, "socketpair(SOCK_NONBLOCK) PASSED");
+ cleanup();
tst_exit();
}
diff --git a/testcases/kernel/syscalls/sockioctl/sockioctl01.c b/testcases/kernel/syscalls/sockioctl/sockioctl01.c
index 1b71012..973a508 100644
--- a/testcases/kernel/syscalls/sockioctl/sockioctl01.c
+++ b/testcases/kernel/syscalls/sockioctl/sockioctl01.c
@@ -137,7 +137,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -168,7 +172,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
diff --git a/testcases/kernel/syscalls/splice/splice02.c b/testcases/kernel/syscalls/splice/splice02.c
index 3f4cd87..d919478 100644
--- a/testcases/kernel/syscalls/splice/splice02.c
+++ b/testcases/kernel/syscalls/splice/splice02.c
@@ -133,7 +133,11 @@
tst_exit();
}
fd=open(av[1], O_WRONLY | O_CREAT | O_TRUNC, 0644);
+<<<<<<< HEAD
if (fd < 0) {
+=======
+ if (fd < 0 ) {
+>>>>>>> master
tst_resm(TFAIL, "open(%s) failed - errno = %d : %s", av[1], errno, strerror(errno));
cleanup();
tst_exit();
diff --git a/testcases/kernel/syscalls/ssetmask/ssetmask01.c b/testcases/kernel/syscalls/ssetmask/ssetmask01.c
index 163c189..6dbbc72 100644
--- a/testcases/kernel/syscalls/ssetmask/ssetmask01.c
+++ b/testcases/kernel/syscalls/ssetmask/ssetmask01.c
@@ -118,7 +118,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
tst_exit();
}
diff --git a/testcases/kernel/syscalls/stat/stat01.c b/testcases/kernel/syscalls/stat/stat01.c
index ffcacda..4aa5658 100644
--- a/testcases/kernel/syscalls/stat/stat01.c
+++ b/testcases/kernel/syscalls/stat/stat01.c
@@ -88,8 +88,8 @@
int TST_TOTAL = 1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
int exp_enos[] = { 0 };
-uid_t User_id; /* Owner id of the test file */
-gid_t Group_id; /* Group id of the test file */
+uid_t user_id; /* Owner id of the test file */
+gid_t group_id; /* Group id of the test file */
char nobody_uid[] = "nobody";
struct passwd *ltpuser;
@@ -104,10 +104,8 @@
/* Parse standard options given to run the test. */
msg = parse_opts(ac, av, NULL, NULL);
- if (msg != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- /*NOTREACHED*/}
/* Perform global setup for test */
setup();
@@ -143,8 +141,8 @@
* Verify the data returned by stat(2)
* aganist the expected data.
*/
- if ((stat_buf.st_uid != User_id) ||
- (stat_buf.st_gid != Group_id) ||
+ if ((stat_buf.st_uid != user_id) ||
+ (stat_buf.st_gid != group_id) ||
(stat_buf.st_size != FILE_SIZE) ||
((stat_buf.st_mode & MASK) != FILE_MODE)) {
tst_resm(TFAIL, "Functionality of "
@@ -164,7 +162,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -187,7 +185,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
@@ -210,7 +208,7 @@
tst_brkm(TBROK, cleanup,
"open(%s, O_RDWR|O_CREAT, %#o) Failed, errno=%d : %s",
TESTFILE, FILE_MODE, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/* Fill the test buffer with the known data */
for (i = 0; i < BUF_SIZE; i++) {
@@ -223,7 +221,7 @@
tst_brkm(TBROK, cleanup,
"write(2) on %s Failed, errno=%d : %s",
TESTFILE, errno, strerror(errno));
- /*NOTREACHED*/} else {
+ } else {
write_len += wbytes;
}
}
@@ -235,8 +233,8 @@
}
/* Get the uid/gid of the process */
- User_id = getuid();
- Group_id = getgid();
+ user_id = getuid();
+ group_id = getgid();
} /* End setup() */
@@ -255,7 +253,4 @@
/* Remove tmp dir and all files in it */
tst_rmdir();
-
- /* exit with return code appropriate for results */
- tst_exit();
} /* End cleanup() */
diff --git a/testcases/kernel/syscalls/stat/stat02.c b/testcases/kernel/syscalls/stat/stat02.c
index 5577687..c9044eb 100644
--- a/testcases/kernel/syscalls/stat/stat02.c
+++ b/testcases/kernel/syscalls/stat/stat02.c
@@ -90,8 +90,8 @@
int TST_TOTAL = 1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
int exp_enos[] = { 0 };
-uid_t User_id; /* eff. user id/group id of test process */
-gid_t Group_id;
+uid_t user_id; /* eff. user id/group id of test process */
+gid_t group_id;
char nobody_uid[] = "nobody";
struct passwd *ltpuser;
@@ -105,11 +105,8 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
- msg = parse_opts(ac, av, NULL, NULL);
- if (msg != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
/* Perform global setup for test */
setup();
@@ -145,8 +142,8 @@
* Verify the data returned by stat(2)
* aganist the expected data.
*/
- if ((stat_buf.st_uid != User_id) ||
- (stat_buf.st_gid != Group_id) ||
+ if ((stat_buf.st_uid != user_id) ||
+ (stat_buf.st_gid != group_id) ||
(stat_buf.st_size != FILE_SIZE) ||
((stat_buf.st_mode & MASK) != NEW_MODE)) {
tst_resm(TFAIL, "Functionality of "
@@ -164,9 +161,8 @@
Tst_count++; /* incr TEST_LOOP counter */
} /* End for TEST_LOOPING */
- /* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -190,7 +186,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
@@ -213,7 +209,7 @@
tst_brkm(TBROK, cleanup,
"open(%s, O_RDWR|O_CREAT, %#o) Failed, errno=%d : %s",
TESTFILE, FILE_MODE, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/* Fill the test buffer with the known data */
for (i = 0; i < BUF_SIZE; i++) {
@@ -223,29 +219,24 @@
/* Write to the file 1k data from the buffer */
while (write_len < FILE_SIZE) {
if ((wbytes = write(fd, tst_buff, sizeof(tst_buff))) <= 0) {
- tst_brkm(TBROK, cleanup,
- "write(2) on %s Failed, errno=%d : %s",
- TESTFILE, errno, strerror(errno));
- /*NOTREACHED*/} else {
+ tst_brkm(TBROK|TERRNO, cleanup, "write to %s failed", TESTFILE);
+ } else {
write_len += wbytes;
}
}
if (close(fd) == -1) {
- tst_resm(TWARN, "close(%s) Failed, errno=%d : %s",
- TESTFILE, errno, strerror(errno));
+ tst_resm(TWARN|TERRNO, "closing %s failed", TESTFILE);
}
/* Modify mode permissions on the testfile */
if (chmod(TESTFILE, NEW_MODE) < 0) {
- tst_brkm(TBROK, cleanup,
- "chmod(2) on %s Failed, errno=%d : %s",
- TESTFILE, errno, strerror(errno));
- /*NOTREACHED*/}
+ tst_brkm(TBROK|TERRNO, cleanup, "chmodding %s failed", TESTFILE);
+ }
/* Get the uid/gid of the process */
- User_id = getuid();
- Group_id = getgid();
+ user_id = getuid();
+ group_id = getgid();
} /* End setup() */
@@ -264,7 +255,4 @@
/* Remove tmp dir and all files in it */
tst_rmdir();
-
- /* exit with return code appropriate for results */
- tst_exit();
} /* End cleanup() */
diff --git a/testcases/kernel/syscalls/stat/stat03.c b/testcases/kernel/syscalls/stat/stat03.c
index aec9d0a..e10cec6 100644
--- a/testcases/kernel/syscalls/stat/stat03.c
+++ b/testcases/kernel/syscalls/stat/stat03.c
@@ -151,11 +151,8 @@
int ind; /* counter to test different test conditions */
/* Parse standard options given to run the test. */
- msg = parse_opts(ac, av, NULL, NULL);
- if (msg != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- /*NOTREACHED*/}
/*
* Invoke setup function to call individual test setup functions
@@ -216,7 +213,7 @@
* in the setup().
*/
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -237,7 +234,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
@@ -300,25 +297,25 @@
/* Creat a test directory */
if (mkdir(DIR_TEMP, MODE_RWX) < 0) {
tst_brkm(TBROK, cleanup, "mkdir(2) of %s failed", DIR_TEMP);
- /*NOTREACHED*/}
+ }
/* Creat a test file under above test directory */
if ((fd = open(TEST_FILE1, O_RDWR | O_CREAT, 0666)) == -1) {
tst_brkm(TBROK, cleanup,
"open(%s, O_RDWR|O_CREAT, 0666) failed, errno=%d : %s",
TEST_FILE1, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/* Close the test file */
if (close(fd) == -1) {
tst_brkm(TBROK, cleanup,
"close(%s) Failed, errno=%d : %s",
TEST_FILE1, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/* Modify mode permissions on test directory */
if (chmod(DIR_TEMP, FILE_MODE) < 0) {
tst_brkm(TBROK, cleanup, "chmod(2) of %s failed", DIR_TEMP);
- /*NOTREACHED*/}
+ }
return 0;
}
@@ -340,13 +337,13 @@
tst_brkm(TBROK, cleanup,
"open(2) on t_file failed, errno=%d : %s",
errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/* Close the test file created above */
if (close(fd) == -1) {
tst_brkm(TBROK, cleanup,
"close(t_file) Failed, errno=%d : %s",
errno, strerror(errno));
- /*NOTREACHED*/}
+ }
return 0;
}
@@ -390,7 +387,4 @@
/* Remove files and temporary directory created */
tst_rmdir();
-
- /* exit with return code appropriate for results */
- tst_exit();
} /* End cleanup() */
diff --git a/testcases/kernel/syscalls/stat/stat05.c b/testcases/kernel/syscalls/stat/stat05.c
index cc06ff4..2aa2fe7 100644
--- a/testcases/kernel/syscalls/stat/stat05.c
+++ b/testcases/kernel/syscalls/stat/stat05.c
@@ -136,23 +136,14 @@
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
- /***************************************************************
- * parse standard options
- ***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /***************************************************************
- * perform global setup for test
- ***************************************************************/
setup();
/* set the expected errnos... */
TEST_EXP_ENOS(exp_enos);
- /***************************************************************
- * check looping state if -c option given
- ***************************************************************/
for (lc = 0; TEST_LOOPING(lc); lc++) {
/* reset Tst_count in case we are looping. */
@@ -166,13 +157,8 @@
/* check return code */
if (TEST_RETURN == -1) {
TEST_ERROR_LOG(TEST_ERRNO);
- tst_resm(TFAIL,
- "stat(%s, &statter) Failed, errno=%d : %s",
- fname, TEST_ERRNO, strerror(TEST_ERRNO));
+ tst_resm(TFAIL, "stat(%s, &statter) failed", fname);
} else {
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
if (STD_FUNCTIONAL_TEST) {
/* No Verification test, yet... */
tst_resm(TPASS,
@@ -183,12 +169,9 @@
} /* End for TEST_LOOPING */
- /***************************************************************
- * cleanup and exit
- ***************************************************************/
cleanup();
+ tst_exit();
- return 0;
} /* End main */
/***************************************************************
@@ -213,8 +196,8 @@
}
if (close(fd) == -1) {
- tst_resm(TWARN, "close(%s) Failed, errno=%d : %s",
- fname, errno, strerror(errno));
+ tst_resm(TWARN|TERRNO, "close(%s) failed",
+ fname);
}
} /* End setup() */
@@ -232,7 +215,4 @@
/* Remove tmp dir and all files in it */
tst_rmdir();
-
- /* exit with return code appropriate for results */
- tst_exit();
} /* End cleanup() */
diff --git a/testcases/kernel/syscalls/statfs/statfs01.c b/testcases/kernel/syscalls/statfs/statfs01.c
index 552753d..336ecb9 100644
--- a/testcases/kernel/syscalls/statfs/statfs01.c
+++ b/testcases/kernel/syscalls/statfs/statfs01.c
@@ -139,6 +139,9 @@
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+
setup();
/* set the expected errnos... */
diff --git a/testcases/kernel/syscalls/statfs/statfs03.c b/testcases/kernel/syscalls/statfs/statfs03.c
index be5fbd2..b2b5b6f 100644
--- a/testcases/kernel/syscalls/statfs/statfs03.c
+++ b/testcases/kernel/syscalls/statfs/statfs03.c
@@ -57,7 +57,6 @@
#include "usctest.h"
#include <pwd.h>
-extern char *TESTDIR;
char *TCID = "statfs03";
int TST_TOTAL = 1;
int fileHandle = 0;
@@ -136,9 +135,9 @@
/* make a temporary directory and cd to it */
tst_tmpdir();
- if (chmod(TESTDIR, S_IRWXU) == -1)
- tst_brkm(TBROK, cleanup, "chmod(%s,700) failed; errno %d: %s",
- TESTDIR, errno, strerror(errno));
+ if (chmod(get_tst_tmpdir(), S_IRWXU) == -1)
+ tst_brkm(TBROK|TERRNO, cleanup, "chmod(%s, 700) failed",
+ get_tst_tmpdir());
/* create a test file */
sprintf(fname, "%s.%d", fname, getpid());
@@ -147,15 +146,16 @@
} else {
sprintf(path, "%s/%s", fname, fname);
if ((fileHandle = creat(path, 0444)) == -1) {
- tst_resm(TFAIL, "creat (2) FAILED to creat temp file");
+ tst_brkm(TFAIL|TERRNO, "creat (2) FAILED to creat temp file");
}
}
ltpuser = getpwnam(nobody_uid);
+ if (ltpuser == NULL)
+ tst_brkm(TBROK|TERRNO, cleanup, "getpwnam failed");
if (seteuid(ltpuser->pw_uid) == -1) {
- tst_resm(TINFO, "seteuid failed to "
+ tst_resm(TINFO|TERRNO, "seteuid failed to "
"to set the effective uid to %d", ltpuser->pw_uid);
- perror("seteuid");
}
}
diff --git a/testcases/kernel/syscalls/statvfs/statvfs01.c b/testcases/kernel/syscalls/statvfs/statvfs01.c
index 8080b5f..f11f762 100644
--- a/testcases/kernel/syscalls/statvfs/statvfs01.c
+++ b/testcases/kernel/syscalls/statvfs/statvfs01.c
@@ -60,45 +60,28 @@
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
- /***************************************************************
- * parse standard options
- ***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /***************************************************************
- * perform global setup for test
- ***************************************************************/
setup();
/* set the expected errnos... */
TEST_EXP_ENOS(exp_enos);
- /***************************************************************
- * check looping state if -c option given
- ***************************************************************/
for (lc = 0; TEST_LOOPING(lc); lc++) {
/* reset Tst_count in case we are looping. */
Tst_count = 0;
- /*
- * TEST CASE:
- * statvfs
- */
- ;
-
/* Call statvfs(2) */
TEST(statvfs(TEST_PATH, &buf));
/* check return code */
if (TEST_RETURN == -1) {
- TEST_ERROR_LOG(TEST_ERRNO);
- tst_resm(TFAIL|TTERRNO,
- "statvfs - Basic sanity test failed");
+ tst_resm(TFAIL|TERRNO, "statvfs(%s, ...) failed",
+ TEST_PATH);
} else {
- TEST_ERROR_LOG(TEST_ERRNO);
- tst_resm(TPASS, "statvfs - Basic sanity test,PASS");
+ tst_resm(TPASS, "statvfs(%s, ...) passed");
}
} /* End for TEST_LOOPING */
@@ -116,7 +99,7 @@
cleanup();
tst_exit();
-} /* End main */
+}
/***************************************************************
* setup() - performs all ONE TIME setup for this test.
@@ -128,7 +111,7 @@
/* Pause if that option was specified */
TEST_PAUSE;
-} /* End setup() */
+}
/***************************************************************
* cleanup() - performs all ONE TIME cleanup for this test at
@@ -141,4 +124,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-} /* End cleanup() */
+}
diff --git a/testcases/kernel/syscalls/stime/stime01.c b/testcases/kernel/syscalls/stime/stime01.c
index 67c5bb2..02161fc 100644
--- a/testcases/kernel/syscalls/stime/stime01.c
+++ b/testcases/kernel/syscalls/stime/stime01.c
@@ -99,11 +99,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
/* Perform global setup for test */
setup();
@@ -127,7 +131,7 @@
* to as far as clock skew is concerned :P.
*/
if (gettimeofday(&real_time_tv, NULL) < 0) {
- tst_brkm(TBROK|TERRNO, tst_exit,
+ tst_brkm(TBROK|TERRNO, NULL,
"failed to get current time via gettimeofday(2)");
}
@@ -207,7 +211,7 @@
/* Check that the test process id is super/root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit,
+ tst_brkm(TBROK, NULL,
"you must be root to execute this test!");
}
diff --git a/testcases/kernel/syscalls/stime/stime02.c b/testcases/kernel/syscalls/stime/stime02.c
index 81dc793..baf3d1d 100644
--- a/testcases/kernel/syscalls/stime/stime02.c
+++ b/testcases/kernel/syscalls/stime/stime02.c
@@ -97,7 +97,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -140,7 +144,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -156,7 +160,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
@@ -172,7 +176,7 @@
if ((curr_time = time(&tloc)) < 0) {
tst_brkm(TBROK, cleanup,
"time() failed to get current time, errno=%d", errno);
- /*NOTREACHED*/}
+ }
/* Get the system's new time */
new_time = curr_time + INCR_TIME;
diff --git a/testcases/kernel/syscalls/swapoff/swapoff01.c b/testcases/kernel/syscalls/swapoff/swapoff01.c
index 805034b..436096c 100644
--- a/testcases/kernel/syscalls/swapoff/swapoff01.c
+++ b/testcases/kernel/syscalls/swapoff/swapoff01.c
@@ -97,9 +97,15 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -136,7 +142,7 @@
/*Clean up and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/* setup() - performs all ONE TIME setup for this test */
@@ -147,7 +153,7 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* Pause if that option was specified */
diff --git a/testcases/kernel/syscalls/swapoff/swapoff02.c b/testcases/kernel/syscalls/swapoff/swapoff02.c
index c224739..4c45cfc 100644
--- a/testcases/kernel/syscalls/swapoff/swapoff02.c
+++ b/testcases/kernel/syscalls/swapoff/swapoff02.c
@@ -126,9 +126,15 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -188,7 +194,7 @@
/*Clean up and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /*End of main */
/*
@@ -245,7 +251,7 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* Pause if that option was specified */
diff --git a/testcases/kernel/syscalls/swapon/swapon01.c b/testcases/kernel/syscalls/swapon/swapon01.c
index 84c310c..0c53f87 100644
--- a/testcases/kernel/syscalls/swapon/swapon01.c
+++ b/testcases/kernel/syscalls/swapon/swapon01.c
@@ -142,7 +142,7 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* Pause if that option was specified */
diff --git a/testcases/kernel/syscalls/swapon/swapon02.c b/testcases/kernel/syscalls/swapon/swapon02.c
index b6041d6..0bec18d 100644
--- a/testcases/kernel/syscalls/swapon/swapon02.c
+++ b/testcases/kernel/syscalls/swapon/swapon02.c
@@ -143,9 +143,8 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
/* perform global setup for test */
uname(&uval);
@@ -364,7 +363,7 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* make a temp directory and cd to it */
diff --git a/testcases/kernel/syscalls/swapon/swapon03.c b/testcases/kernel/syscalls/swapon/swapon03.c
index e845d43..6f88bbe 100644
--- a/testcases/kernel/syscalls/swapon/swapon03.c
+++ b/testcases/kernel/syscalls/swapon/swapon03.c
@@ -448,7 +448,7 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* make a temp directory and cd to it */
diff --git a/testcases/kernel/syscalls/symlink/symlink02.c b/testcases/kernel/syscalls/symlink/symlink02.c
index 1bd7fab..d189210 100644
--- a/testcases/kernel/syscalls/symlink/symlink02.c
+++ b/testcases/kernel/syscalls/symlink/symlink02.c
@@ -138,7 +138,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/symlink/symlink03.c b/testcases/kernel/syscalls/symlink/symlink03.c
index e7aca2c..6dfb611 100644
--- a/testcases/kernel/syscalls/symlink/symlink03.c
+++ b/testcases/kernel/syscalls/symlink/symlink03.c
@@ -159,11 +159,15 @@
int ind; /* counter to test different test conditions */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
/*
* Invoke setup function to call individual test setup functions
@@ -224,7 +228,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -249,7 +253,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1)
@@ -301,23 +305,23 @@
if (mkdir(DIR_TEMP, MODE_RWX) < 0) {
tst_brkm(TBROK, cleanup, "mkdir(2) of %s failed", DIR_TEMP);
- /*NOTREACHED*/}
+ }
if ((fd = open(TEST_FILE1, O_RDWR | O_CREAT, 0666)) == -1) {
tst_brkm(TBROK, cleanup,
"open(%s, O_RDWR|O_CREAT, 0666) failed, errno=%d : %s",
TEST_FILE1, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
if (close(fd) == -1) {
tst_brkm(TBROK, cleanup,
"close(%s) Failed, errno=%d : %s",
TEST_FILE1, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/* Modify mode permissions on test directory */
if (chmod(DIR_TEMP, FILE_MODE) < 0) {
tst_brkm(TBROK, cleanup, "chmod(2) of %s failed", DIR_TEMP);
- /*NOTREACHED*/}
+ }
return 0;
}
@@ -333,18 +337,18 @@
tst_brkm(TBROK, cleanup,
"open(%s, O_RDWR|O_CREAT, 0666) failed, errno=%d : %s",
TEST_FILE1, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
if (close(fd) == -1) {
tst_brkm(TBROK, cleanup,
"close(%s) Failed, errno=%d : %s",
TEST_FILE2, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
if (symlink(TEST_FILE2, SYM_FILE2) < 0) {
tst_brkm(TBROK, cleanup,
"symlink() Fails to create %s in setup2, error=%d",
SYM_FILE2, errno);
- /*NOTREACHED*/}
+ }
return 0;
}
@@ -382,11 +386,11 @@
tst_brkm(TBROK, cleanup,
"open(2) on t_file failed, errno=%d : %s",
errno, strerror(errno));
- /*NOTREACHED*/}
+ }
if (close(fd) == -1) {
tst_brkm(TBROK, cleanup, "close(t_file) Failed, errno=%d : %s",
errno, strerror(errno));
- /*NOTREACHED*/}
+ }
return 0;
}
diff --git a/testcases/kernel/syscalls/symlink/symlink04.c b/testcases/kernel/syscalls/symlink/symlink04.c
index 9732d22..af406c1 100644
--- a/testcases/kernel/syscalls/symlink/symlink04.c
+++ b/testcases/kernel/syscalls/symlink/symlink04.c
@@ -97,11 +97,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
/* Perform global setup for test */
setup();
@@ -140,7 +144,7 @@
tst_brkm(TFAIL, cleanup, "lstat(2) of "
"%s failed, error:%d", SYMFILE,
errno);
- /*NOTREACHED*/}
+ }
/* Check if the st_mode contains a link */
if (!S_ISLNK(stat_buf.st_mode)) {
@@ -162,13 +166,13 @@
tst_brkm(TBROK, cleanup,
"unlink(%s) Failed, errno=%d : %s",
SYMFILE, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
Tst_count++; /* incr TEST_LOOP counter */
} /* End for TEST_LOOPING */
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
@@ -200,7 +204,7 @@
tst_brkm(TBROK, cleanup,
"open(%s, O_RDWR|O_CREAT, %#o) Failed, errno=%d : %s",
TESTFILE, FILE_MODE, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/* Close the temporary file created above */
if (close(fd) == -1) {
diff --git a/testcases/kernel/syscalls/symlink/symlink05.c b/testcases/kernel/syscalls/symlink/symlink05.c
index 2beb907..ea5673b 100644
--- a/testcases/kernel/syscalls/symlink/symlink05.c
+++ b/testcases/kernel/syscalls/symlink/symlink05.c
@@ -97,11 +97,15 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
/* Perform global setup for test */
setup();
@@ -141,7 +145,7 @@
tst_brkm(TFAIL, cleanup, "lstat(2) of "
"%s failed, error:%d",
SYMFILE, errno);
- /*NOTREACHED*/}
+ }
/* Check if the st_mode contains a link */
if (!S_ISLNK(stat_buf.st_mode)) {
@@ -169,7 +173,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
diff --git a/testcases/kernel/syscalls/symlinkat/symlinkat01.c b/testcases/kernel/syscalls/symlinkat/symlinkat01.c
index 44bb52c..7035b80 100644
--- a/testcases/kernel/syscalls/symlinkat/symlinkat01.c
+++ b/testcases/kernel/syscalls/symlinkat/symlinkat01.c
@@ -151,7 +151,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/sync/sync01.c b/testcases/kernel/syscalls/sync/sync01.c
index 955214e..d210374 100644
--- a/testcases/kernel/syscalls/sync/sync01.c
+++ b/testcases/kernel/syscalls/sync/sync01.c
@@ -133,7 +133,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/sync/sync02.c b/testcases/kernel/syscalls/sync/sync02.c
index 08c7698..2794e66 100644
--- a/testcases/kernel/syscalls/sync/sync02.c
+++ b/testcases/kernel/syscalls/sync/sync02.c
@@ -97,10 +97,16 @@
char read_buffer[BUFSIZ]; /* buffer used to read data from file */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+ if (msg != NULL) {
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
/* Perform global setup for test */
setup();
@@ -129,7 +135,7 @@
tst_brkm(TFAIL, cleanup, "lseek() "
"failed on %s, error=%d",
TEMP_FILE, errno);
- /*NOTREACHED*/}
+ }
/* Read the contents of file */
if (read(fildes, read_buffer,
@@ -147,7 +153,7 @@
tst_brkm(TFAIL, cleanup,
"read() Fails on %s, error=%d",
TEMP_FILE, errno);
- /*NOTREACHED*/}
+ }
} else {
tst_resm(TPASS, "call succeeded");
}
@@ -157,7 +163,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
@@ -191,7 +197,7 @@
tst_brkm(TBROK, cleanup,
"open(%s, O_RDWR | O_CREAT, %#o) Failed, errno=%d :%s",
TEMP_FILE, FILE_MODE, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/* Write the buffer data into file */
if (write(fildes, write_buffer, strlen(write_buffer) + 1) !=
@@ -199,7 +205,7 @@
tst_brkm(TBROK, cleanup,
"write() failed to write buffer data to %s",
TEMP_FILE);
- /*NOTREACHED*/}
+ }
} /* End setup() */
diff --git a/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c b/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c
index b56c8ca..ee75611 100644
--- a/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c
+++ b/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c
@@ -123,12 +123,11 @@
unsigned int flags;
int error;
} test_data[] = {
- {
- &bfd, 0, 1, SYNC_FILE_RANGE_WRITE, EBADF}, {
- &sfd, 0, 1, SYNC_FILE_RANGE_WAIT_AFTER, ESPIPE}, {
- &filed, -1, 1, SYNC_FILE_RANGE_WAIT_BEFORE, EINVAL}, {
- &filed, 0, -1, SYNC_FILE_RANGE_WRITE, EINVAL}, {
- &filed, 0, 1, SYNC_FILE_RANGE_INVALID, EINVAL}
+ { &bfd, 0, 1, SYNC_FILE_RANGE_WRITE, EBADF},
+ { &sfd, 0, 1, SYNC_FILE_RANGE_WAIT_AFTER, ESPIPE},
+ { &filed, -1, 1, SYNC_FILE_RANGE_WAIT_BEFORE, EINVAL},
+ { &filed, 0, -1, SYNC_FILE_RANGE_WRITE, EINVAL},
+ { &filed, 0, 1, SYNC_FILE_RANGE_INVALID, EINVAL}
};
int TST_TOTAL = sizeof(test_data) / sizeof(test_data[0]);
@@ -161,15 +160,11 @@
/* close the file we have open */
if (close(filed) == -1) {
- tst_resm(TWARN, "close(%s) Failed, errno=%d : %s", filename,
- errno, strerror(errno));
+ tst_resm(TWARN|TERRNO, "close(%s) failed", filename);
}
/* Remove tmp dir and all files in it */
tst_rmdir();
-
- /* exit with return code appropriate for results */
- tst_exit();
}
/* Local Functions */
@@ -203,15 +198,11 @@
sprintf(filename, "tmpfile_%d", getpid());
if ((filed = open(filename, O_RDWR | O_CREAT, 0700)) == -1) {
- tst_brkm(TBROK, cleanup,
- "open(%s, O_RDWR|O_CREAT,0700) Failed, errno=%d : %s",
- filename, errno, strerror(errno));
-
+ tst_brkm(TBROK|TERRNO, cleanup,
+ "open(%s, O_RDWR|O_CREAT,0700) failed", filename);
}
- sfd = open(spl_file, O_RDWR | O_CREAT, 0700);
-
- return;
+ sfd = open(spl_file, O_RDWR|O_CREAT, 0700);
}
/*****************************************************************************
@@ -258,71 +249,55 @@
/* On success - exits with 0 exit value. */
/* */
/******************************************************************************/
-int main(int ac, /* number of command line parameters */
- char **av)
-{ /* pointer to the array of the command line parameters. */
+int main(int ac, char **av)
+{
int test_index = 0;
- int lc;
char *msg;
- /***************************************************************
- parse standard options$
- ********************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
#if defined(__powerpc__) || defined(__powerpc64__) /* for PPC, kernel version > 2.6.21 needed */
if (tst_kvercmp(2, 16, 22) < 0) {
- tst_resm(TCONF, "System doesn't support execution of the test");
- tst_exit();
+ tst_brkm(TCONF, NULL, "System doesn't support execution of the test");
}
#else
/* For other archs, need kernel version > 2.6.16 */
if (tst_kvercmp(2, 6, 17) < 0) {
- tst_resm(TCONF, "System doesn't support execution of the test");
- tst_exit();
+ tst_brkm(TCONF, NULL, "System doesn't support execution of the test");
}
#endif
-/* perform global test setup, call setup() function. */
setup();
- for (lc = 0; TEST_LOOPING(lc); lc++) {
- /* reset Tst_count in case we are looping. */
- Tst_count = 0;
+ for (test_index = 0; test_index < TST_TOTAL; test_index++) {
+ TEST(syncfilerange
+ (*(test_data[test_index].fd),
+ test_data[test_index].offset,
+ test_data[test_index].nbytes,
+ test_data[test_index].flags));
- for (test_index = 0; test_index < TST_TOTAL; test_index++) {
- TEST(syncfilerange
- (*(test_data[test_index].fd),
- test_data[test_index].offset,
- test_data[test_index].nbytes,
- test_data[test_index].flags));
+ if (TEST_RETURN != -1) {
+ tst_resm(TFAIL,
+ "call succeeded unexpectedly (%ld != -1)",
+ TEST_RETURN);
+ continue;
+ }
- if (TEST_RETURN != -1) {
- tst_resm(TFAIL,
- "call succeeded unexpectedly "
- "(%ld != -1)", TEST_RETURN);
- continue;
- }
+ TEST_ERROR_LOG(TEST_ERRNO);
- TEST_ERROR_LOG(TEST_ERRNO);
-
- if (TEST_ERRNO == test_data[test_index].error) {
- tst_resm(TPASS, "expected failure - "
- "errno = %d : %s", TEST_ERRNO,
- strerror(TEST_ERRNO));
- } else {
- tst_resm(TFAIL, "unexpected error - %d : %s - "
- "expected %d", TEST_ERRNO,
- strerror(TEST_ERRNO),
- test_data[test_index].error);
- }
+ if (TEST_ERRNO == test_data[test_index].error) {
+ tst_resm(TPASS|TTERRNO, "got expected error");
+ } else {
+ tst_resm(TFAIL|TTERRNO, "got unexpected error; "
+ "expected %d",
+ test_data[test_index].error);
}
}
cleanup();
- return 0;
+ tst_exit();
}
diff --git a/testcases/kernel/syscalls/sysctl/sysctl01.c b/testcases/kernel/syscalls/sysctl/sysctl01.c
index 6249b96..f2769ec 100644
--- a/testcases/kernel/syscalls/sysctl/sysctl01.c
+++ b/testcases/kernel/syscalls/sysctl/sysctl01.c
@@ -103,7 +103,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -157,7 +161,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
diff --git a/testcases/kernel/syscalls/sysctl/sysctl03.c b/testcases/kernel/syscalls/sysctl/sysctl03.c
index 5b9530d..d82b14c 100644
--- a/testcases/kernel/syscalls/sysctl/sysctl03.c
+++ b/testcases/kernel/syscalls/sysctl/sysctl03.c
@@ -192,7 +192,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
@@ -202,7 +202,7 @@
{
/* test must be run as root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* capture signals */
diff --git a/testcases/kernel/syscalls/sysctl/sysctl04.c b/testcases/kernel/syscalls/sysctl/sysctl04.c
index 644fdf2..c7b3fa4 100644
--- a/testcases/kernel/syscalls/sysctl/sysctl04.c
+++ b/testcases/kernel/syscalls/sysctl/sysctl04.c
@@ -97,7 +97,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -138,7 +142,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
/*
diff --git a/testcases/kernel/syscalls/sysctl/sysctl05.c b/testcases/kernel/syscalls/sysctl/sysctl05.c
index 6b06ef5..eea7e66 100644
--- a/testcases/kernel/syscalls/sysctl/sysctl05.c
+++ b/testcases/kernel/syscalls/sysctl/sysctl05.c
@@ -109,7 +109,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup();
@@ -156,7 +160,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
#else
diff --git a/testcases/kernel/syscalls/sysfs/sysfs02.c b/testcases/kernel/syscalls/sysfs/sysfs02.c
index 7cf46bb..ce378c1 100644
--- a/testcases/kernel/syscalls/sysfs/sysfs02.c
+++ b/testcases/kernel/syscalls/sysfs/sysfs02.c
@@ -118,7 +118,7 @@
/*Clean up and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/* setup() - performs all ONE TIME setup for this test */
diff --git a/testcases/kernel/syscalls/sysinfo/sysinfo01.c b/testcases/kernel/syscalls/sysinfo/sysinfo01.c
index c9ddad2..cbdfbf0 100644
--- a/testcases/kernel/syscalls/sysinfo/sysinfo01.c
+++ b/testcases/kernel/syscalls/sysinfo/sysinfo01.c
@@ -93,8 +93,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup(); /* Global setup */
@@ -110,7 +114,7 @@
/* To gather stats on errnos returned, log the errno */
tst_brkm(TFAIL, cleanup, "sysinfo() Failed, errno=%d"
" : %s", TEST_ERRNO, strerror(TEST_ERRNO));
- /*NOTREACHED*/} else {
+ } else {
/* Test succeeded */
/* This portion of the code generates information
@@ -153,7 +157,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
diff --git a/testcases/kernel/syscalls/sysinfo/sysinfo02.c b/testcases/kernel/syscalls/sysinfo/sysinfo02.c
index ef4df9f..ffa80a9 100644
--- a/testcases/kernel/syscalls/sysinfo/sysinfo02.c
+++ b/testcases/kernel/syscalls/sysinfo/sysinfo02.c
@@ -92,8 +92,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup(); /* Global setup */
@@ -113,10 +117,10 @@
/* Test Failed */
tst_brkm(TFAIL, cleanup, "sysinfo() Failed, Expected -1"
"returned %d/n", TEST_ERRNO);
- /*NOTREACHED*/}
+ }
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
diff --git a/testcases/kernel/syscalls/syslog/syslog11.c b/testcases/kernel/syscalls/syslog/syslog11.c
index 8f1be07..b4d4560 100644
--- a/testcases/kernel/syscalls/syslog/syslog11.c
+++ b/testcases/kernel/syscalls/syslog/syslog11.c
@@ -167,7 +167,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
int setup1(void)
@@ -185,7 +185,7 @@
{
/* Change effective user id to root */
if (seteuid(0) == -1) {
- tst_brkm(TBROK, tst_exit, "seteuid failed to set the effective"
+ tst_brkm(TBROK, NULL, "seteuid failed to set the effective"
" uid to root");
}
}
@@ -201,13 +201,13 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Must be root for this test!");
- /*NOTREACHED*/}
+ tst_brkm(TBROK, NULL, "Must be root for this test!");
+ }
/* Check for nobody_uid user id */
if ((ltpuser = getpwnam("nobody")) == NULL) {
- tst_brkm(TBROK, tst_exit, "nobody user id doesn't exist");
- /* NOTREACHED */
+ tst_brkm(TBROK, NULL, "nobody user id doesn't exist");
+
}
/* Pause if that option was specified
@@ -232,4 +232,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/syslog/syslog12.c b/testcases/kernel/syscalls/syslog/syslog12.c
index ab98b80..58a3315 100644
--- a/testcases/kernel/syscalls/syslog/syslog12.c
+++ b/testcases/kernel/syscalls/syslog/syslog12.c
@@ -190,7 +190,7 @@
}
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
}
int setup1(void)
@@ -208,7 +208,7 @@
{
/* Change effective user id to root */
if (seteuid(0) == -1) {
- tst_brkm(TBROK, tst_exit, "seteuid failed to set the effective"
+ tst_brkm(TBROK, NULL, "seteuid failed to set the effective"
" uid to root");
}
}
@@ -224,13 +224,13 @@
/* Check whether we are root */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Must be root for this test!");
- /*NOTREACHED*/}
+ tst_brkm(TBROK, NULL, "Must be root for this test!");
+ }
/* Check for nobody_uid user id */
if ((ltpuser = getpwnam("nobody")) == NULL) {
- tst_brkm(TBROK, tst_exit, "nobody user id doesn't exist");
- /* NOTREACHED */
+ tst_brkm(TBROK, NULL, "nobody user id doesn't exist");
+
}
/* set the expected errnos... */
@@ -258,4 +258,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/tee/tee01.c b/testcases/kernel/syscalls/tee/tee01.c
index 5269016..6f01ea4 100644
--- a/testcases/kernel/syscalls/tee/tee01.c
+++ b/testcases/kernel/syscalls/tee/tee01.c
@@ -94,7 +94,11 @@
* parse standard options
*/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/*
* perform global setup for test
diff --git a/testcases/kernel/syscalls/time/time01.c b/testcases/kernel/syscalls/time/time01.c
index 642e2f5..848dd3e 100644
--- a/testcases/kernel/syscalls/time/time01.c
+++ b/testcases/kernel/syscalls/time/time01.c
@@ -130,23 +130,14 @@
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
- /***************************************************************
- * parse standard options
- ***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /***************************************************************
- * perform global setup for test
- ***************************************************************/
setup();
/* set the expected errnos... */
TEST_EXP_ENOS(exp_enos);
- /***************************************************************
- * check looping state if -c option given
- ***************************************************************/
for (lc = 0; TEST_LOOPING(lc); lc++) {
/* reset Tst_count in case we are looping. */
@@ -163,9 +154,6 @@
tst_resm(TFAIL, "time(0) Failed, errno=%d : %s",
TEST_ERRNO, strerror(TEST_ERRNO));
} else {
- /***************************************************************
- * only perform functional verification if flag set (-f not given)
- ***************************************************************/
if (STD_FUNCTIONAL_TEST) {
/* No Verification test, yet... */
tst_resm(TPASS, "time(0) returned %ld",
@@ -174,12 +162,9 @@
}
} /* End for TEST_LOOPING */
- /***************************************************************
- * cleanup and exit
- ***************************************************************/
cleanup();
- return 0;
+ tst_exit();
} /* End main */
/***************************************************************
@@ -207,7 +192,4 @@
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-
- /* exit with return code appropriate for results */
- tst_exit();
} /* End cleanup() */
diff --git a/testcases/kernel/syscalls/time/time02.c b/testcases/kernel/syscalls/time/time02.c
index fa1d3ce..75bc1ba 100644
--- a/testcases/kernel/syscalls/time/time02.c
+++ b/testcases/kernel/syscalls/time/time02.c
@@ -93,7 +93,11 @@
time_t tloc; /* time_t variables for time(2) */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -147,7 +151,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
diff --git a/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c b/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c
index b129d29..2fef966 100644
--- a/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c
+++ b/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c
@@ -130,7 +130,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
tst_exit();
}
@@ -160,7 +164,11 @@
ENTER(0);
TEST( syscall(__NR_timer_getoverrun, -1 ));
+<<<<<<< HEAD
if (TEST_RETURN < 0 && TEST_ERRNO == EINVAL) {
+=======
+ if (TEST_RETURN < 0 && TEST_ERRNO == EINVAL ) {
+>>>>>>> master
tst_resm(TPASS, "Block %d: test %d PASSED", block, Tst_count );
} else {
tst_resm(TFAIL, "Block %d: test %d FAILED... errno = %d : %s", block, Tst_count,TEST_ERRNO, strerror(TEST_ERRNO) );
diff --git a/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c b/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c
index 9a662bb..85fc49c 100644
--- a/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c
+++ b/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c
@@ -81,11 +81,11 @@
/* */
/******************************************************************************/
extern void cleanup() {
- /* Remove tmp dir and all files in it */
- TEST_CLEANUP;
- tst_rmdir();
- /* Exit with appropriate return code. */
- tst_exit();
+ /* Remove tmp dir and all files in it */
+ TEST_CLEANUP;
+ tst_rmdir();
+ /* Exit with appropriate return code. */
+ tst_exit();
}
/* Local Functions */
@@ -107,15 +107,15 @@
/* */
/******************************************************************************/
void setup() {
- /* Capture signals if any */
- /* Create temporary directories */
- TEST_PAUSE;
+ /* Capture signals if any */
+ /* Create temporary directories */
+ TEST_PAUSE;
- tst_tmpdir();
+ tst_tmpdir();
}
#define ENTER(normal) tst_resm(TINFO, "Enter block %d: test %d (%s)", \
- block, Tst_count, normal?"NORMAL":"ERROR");
+ block, Tst_count, normal?"NORMAL":"ERROR");
char tmpname[40];
int parent;
@@ -124,81 +124,81 @@
int main(int ac, char **av) {
- int lc; /* loop counter */
- char *msg; /* message returned from parse_opts */
+ int lc; /* loop counter */
+ char *msg; /* message returned from parse_opts */
- kernel_timer_t created_timer_id;
- struct sigevent ev;
- struct itimerspec spec;
+ kernel_timer_t created_timer_id;
+ struct sigevent ev;
+ struct itimerspec spec;
-
- /* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
- tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
+ /* parse standard options */
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- setup();
+ setup();
- /* Check looping state if -i option given */
- for (lc = 0; TEST_LOOPING(lc); ++lc) {
- Tst_count = 0;
- for (testno = 0; testno < TST_TOTAL; ++testno) {
- ENTER(1);
- ev.sigev_value = (sigval_t)0;
- ev.sigev_signo = SIGALRM;
- ev.sigev_notify = SIGEV_SIGNAL;
- TEST(syscall(__NR_timer_create, CLOCK_REALTIME, &ev, &created_timer_id ));
- TEST( syscall(__NR_timer_gettime, created_timer_id, &spec ));
+ /* Check looping state if -i option given */
+ for (lc = 0; TEST_LOOPING(lc); ++lc) {
+ Tst_count = 0;
+ for (testno = 0; testno < TST_TOTAL; ++testno) {
+ ENTER(1);
+ ev.sigev_value = (sigval_t)0;
+ ev.sigev_signo = SIGALRM;
+ ev.sigev_notify = SIGEV_SIGNAL;
+ TEST(syscall(__NR_timer_create, CLOCK_REALTIME, &ev,
+ &created_timer_id));
+ TEST(syscall(__NR_timer_gettime, created_timer_id,
+ &spec));
if (TEST_RETURN == 0) {
- tst_resm(TPASS, "Block %d: test %d PASSED", block, Tst_count );
- } else {
- tst_resm(TFAIL, "Block %d: test %d FAILED... errno = %d : %s", block, Tst_count,TEST_ERRNO, strerror(TEST_ERRNO) );
- cleanup();
- tst_exit();
- }
-
+ tst_resm(TPASS, "Block %d: test %d PASSED",
+ block, Tst_count);
+ } else {
+ tst_brkm(TFAIL|TERRNO, cleanup,
+ "Block %d: test %d FAILED",
+ block, Tst_count);
+ }
-
/*
ERRORS
-EINVAL
- An invalid timer_id value was specified.
+ An invalid timer_id value was specified.
*/
- ENTER(0);
- TEST( syscall(__NR_timer_gettime, -1, &spec ));
- if (TEST_RETURN < 0 && TEST_ERRNO == EINVAL) {
- tst_resm(TPASS, "Block %d: test %d PASSED", block, Tst_count );
- } else {
- tst_resm(TFAIL, "Block %d: test %d FAILED... errno = %d : %s", block, Tst_count,TEST_ERRNO, strerror(TEST_ERRNO) );
- cleanup();
- tst_exit();
- }
+ ENTER(0);
+ TEST(syscall(__NR_timer_gettime, -1, &spec));
+ if (TEST_RETURN < 0 && TEST_ERRNO == EINVAL) {
+ tst_resm(TPASS,
+ "Block %d: test %d PASSED",
+ block, Tst_count);
+ } else {
+ tst_brkm(TFAIL|TERRNO, cleanup,
+ "Block %d: test %d FAILED",
+ block, Tst_count);
+ }
/*
-EFAULT
- An invalid address of setting was specified.
+ An invalid address of setting was specified.
*/
+ ENTER(0);
+ TEST(syscall(__NR_timer_gettime, created_timer_id,
+ NULL));
+ if (TEST_RETURN < 0 && TEST_ERRNO == EFAULT ) {
+ tst_resm(TPASS,
+ "Block %d: test %d PASSED",
+ block, Tst_count);
+ } else {
+ tst_brkm(TFAIL|TERRNO, cleanup,
+ "Block %d: test %d FAILED",
+ block, Tst_count);
+ }
- ENTER(0);
- TEST( syscall(__NR_timer_gettime, created_timer_id, NULL ));
- if (TEST_RETURN < 0 && TEST_ERRNO == EFAULT) {
- tst_resm(TPASS, "Block %d: test %d PASSED", block, Tst_count );
- } else {
- tst_resm(TFAIL, "Block %d: test %d FAILED... errno = %d : %s", block, Tst_count,TEST_ERRNO, strerror(TEST_ERRNO) );
- cleanup();
- tst_exit();
- }
+ }
+ }
-
-
-
- }
- }
cleanup();
- tst_exit();
-}
+ tst_exit();
+}
diff --git a/testcases/kernel/syscalls/timerfd/timerfd02.c b/testcases/kernel/syscalls/timerfd/timerfd02.c
index 043fc66..58183bf 100644
--- a/testcases/kernel/syscalls/timerfd/timerfd02.c
+++ b/testcases/kernel/syscalls/timerfd/timerfd02.c
@@ -142,7 +142,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
diff --git a/testcases/kernel/syscalls/timerfd/timerfd03.c b/testcases/kernel/syscalls/timerfd/timerfd03.c
index 4a4ca8f..9f16683 100644
--- a/testcases/kernel/syscalls/timerfd/timerfd03.c
+++ b/testcases/kernel/syscalls/timerfd/timerfd03.c
@@ -138,7 +138,11 @@
char *msg; /* message returned from parse_opts */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(argc, argv, NULL, NULL);
+=======
+ msg = parse_opts(argc, argv, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
diff --git a/testcases/kernel/syscalls/times/times01.c b/testcases/kernel/syscalls/times/times01.c
index 3b403bf..2108b39 100644
--- a/testcases/kernel/syscalls/times/times01.c
+++ b/testcases/kernel/syscalls/times/times01.c
@@ -137,7 +137,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/times/times03.c b/testcases/kernel/syscalls/times/times03.c
index 4f3ec76..b802f40 100644
--- a/testcases/kernel/syscalls/times/times03.c
+++ b/testcases/kernel/syscalls/times/times03.c
@@ -160,7 +160,7 @@
pid2 = FORK_OR_VFORK();
if (pid2 < 0) {
tst_brkm(TFAIL, cleanup, "Fork failed");
- /*NOTREACHED*/} else if (pid2 == 0) {
+ } else if (pid2 == 0) {
/* Spend some cycles in userspace */
@@ -237,7 +237,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
@@ -303,4 +303,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/tkill/tkill02.c b/testcases/kernel/syscalls/tkill/tkill02.c
index 6b6ec3c..130cb75 100644
--- a/testcases/kernel/syscalls/tkill/tkill02.c
+++ b/testcases/kernel/syscalls/tkill/tkill02.c
@@ -58,7 +58,6 @@
/* Global Variables */
char *TCID = "tkill02"; /* Test program identifier.*/
int testno;
-int TST_TOTAL = 2; /* total number of tests in this file. */
/* Extern Global Functions */
/******************************************************************************/
@@ -117,55 +116,32 @@
{ 99999, ESRCH }
};
+int TST_TOTAL = sizeof(test_cases) / sizeof(test_cases[0]);
+
int main(int ac, char **av) {
int lc; /* loop counter */
- char *msg; /* message returned from parse_opts */
- int i, succeed=0, fail=0;
-
- /* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
- tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+ int i;
setup();
- /* Check looping state if -i option given */
- for (lc = 0; TEST_LOOPING(lc); ++lc) {
- Tst_count = 0;
- for (testno = 0; testno < TST_TOTAL; ++testno) {
+ for (i = 0; i < TST_TOTAL; i++) {
- for (i=0; i<2; i++) {
+ TEST(syscall(__NR_tkill, test_cases[i].tid, SIGUSR1));
- TEST(syscall(__NR_tkill, test_cases[i].tid, SIGUSR1));
-
- if (TEST_RETURN == -1) {
- if (TEST_ERRNO == test_cases[i].exp_errno) {
- tst_resm(TINFO|TTERRNO,
- "tkill call with "
- "tid=%d got expected "
- "errno",
- test_cases[i].tid);
- succeed++;
- } else {
- tst_resm(TFAIL|TTERRNO,
- "tkill call with "
- "tid=%d got unexpected "
- "errno",
- test_cases[i].tid);
- fail++;
- }
- } else {
- tst_resm(TINFO,
- "tkill with tid=%d succeeded "
- "unexpectedly",
- test_cases[i].tid);
- }
- }
-
- if (fail != 0) {
- tst_brkm(TFAIL|TERRNO, cleanup, "tkill failed");
+ if (TEST_RETURN == -1) {
+ if (TEST_ERRNO == test_cases[i].exp_errno) {
+ tst_resm(TINFO|TTERRNO,
+ "tkill(%d, SIGUSR1) failed as expected",
+ test_cases[i].tid);
} else {
- tst_resm(TPASS, "tkill() passed");
+ tst_brkm(TFAIL|TTERRNO, cleanup,
+ "tkill(%d, SIGUSR1) failed unexpectedly",
+ test_cases[i].tid);
}
+ } else {
+ tst_brkm(TFAIL, cleanup,
+ "tkill(%d) succeeded unexpectedly",
+ test_cases[i].tid);
}
}
cleanup();
diff --git a/testcases/kernel/syscalls/truncate/truncate01.c b/testcases/kernel/syscalls/truncate/truncate01.c
index dd5398a..8a8b8c9 100644
--- a/testcases/kernel/syscalls/truncate/truncate01.c
+++ b/testcases/kernel/syscalls/truncate/truncate01.c
@@ -101,7 +101,11 @@
off_t file_length; /* test file length */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -145,7 +149,7 @@
tst_brkm(TFAIL, cleanup, "stat(2) of "
"%s failed, error:%d",
TESTFILE, errno);
- /*NOTREACHED*/}
+ }
stat_buf.st_mode &= ~S_IFREG;
file_length = stat_buf.st_size;
@@ -172,7 +176,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
@@ -213,7 +217,7 @@
tst_brkm(TBROK, cleanup,
"open(%s, O_RDWR|O_CREAT, %o) Failed, errno=%d : %s",
TESTFILE, FILE_MODE, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/* Write to the file 1k data from the buffer */
while (c_total < FILE_SIZE) {
@@ -221,7 +225,7 @@
tst_brkm(TBROK, cleanup,
"write(2) on %s Failed, errno=%d : %s",
TESTFILE, errno, strerror(errno));
- /*NOTREACHED*/} else {
+ } else {
c_total += c;
}
}
@@ -231,7 +235,7 @@
tst_brkm(TBROK, cleanup,
"close(%s) Failed, errno=%d : %s",
TESTFILE, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
} /* End setup() */
/*
diff --git a/testcases/kernel/syscalls/truncate/truncate02.c b/testcases/kernel/syscalls/truncate/truncate02.c
index c08213a..db619f9 100644
--- a/testcases/kernel/syscalls/truncate/truncate02.c
+++ b/testcases/kernel/syscalls/truncate/truncate02.c
@@ -108,7 +108,11 @@
int err_flag = 0; /* error indicator flag */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -152,7 +156,7 @@
tst_brkm(TFAIL, cleanup, "stat(2) of "
"%s failed after 1st truncate, "
"error:%d", TESTFILE, errno);
- /*NOTREACHED*/}
+ }
file_length1 = stat_buf.st_size;
/*
@@ -163,7 +167,7 @@
tst_brkm(TFAIL, cleanup, "lseek(2) on "
"%s failed after 1st truncate, "
"error:%d", TESTFILE, errno);
- /*NOTREACHED*/}
+ }
/* Read the testfile from the beginning. */
while ((rbytes = read(fd, tst_buff,
@@ -195,7 +199,7 @@
tst_brkm(TFAIL, cleanup, "stat(2) of "
"%s failed after 2nd truncate, "
"error:%d", TESTFILE, errno);
- /*NOTREACHED*/}
+ }
file_length2 = stat_buf.st_size;
/*
@@ -206,7 +210,7 @@
tst_brkm(TFAIL, cleanup, "lseek(2) on "
"%s failed after 2nd truncate, "
"error:%d", TESTFILE, errno);
- /*NOTREACHED*/}
+ }
/* Read the testfile contents till EOF */
while ((rbytes = read(fd, tst_buff,
@@ -243,7 +247,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
@@ -283,7 +287,7 @@
tst_brkm(TBROK, cleanup,
"open(%s, O_RDWR|O_CREAT, %o) Failed, errno=%d : %s",
TESTFILE, FILE_MODE, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/* Write to the file 1k data from the buffer */
while (write_len < FILE_SIZE) {
diff --git a/testcases/kernel/syscalls/truncate/truncate03.c b/testcases/kernel/syscalls/truncate/truncate03.c
index b31f7b5..164b4b2 100644
--- a/testcases/kernel/syscalls/truncate/truncate03.c
+++ b/testcases/kernel/syscalls/truncate/truncate03.c
@@ -149,7 +149,11 @@
int ind;
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -211,7 +215,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -234,7 +238,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
@@ -263,7 +267,7 @@
tst_brkm(TBROK, cleanup,
"open(%s, O_RDWR|O_CREAT, %o) Failed, errno=%d : %s",
TEST_FILE1, FILE_MODE, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/* Write to the file 1k data from the buffer */
while (c_total < FILE_SIZE) {
@@ -271,7 +275,7 @@
tst_brkm(TBROK, cleanup,
"write(2) on %s Failed, errno=%d : %s",
TEST_FILE1, errno, strerror(errno));
- /*NOTREACHED*/} else {
+ } else {
c_total += c;
}
}
@@ -281,7 +285,7 @@
tst_brkm(TBROK, cleanup,
"close(%s) Failed, errno=%d : %s",
TEST_FILE1, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
#if !defined(UCLINUX)
bad_addr = mmap(0, 1, PROT_NONE,
MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, 0, 0);
@@ -322,7 +326,7 @@
/* Change mode permissions on test file */
if (chmod(TEST_FILE1, NEW_MODE) < 0) {
tst_brkm(TBROK, cleanup, "chmod(2) of %s failed", TEST_FILE1);
- /*NOTREACHED*/}
+ }
return 0;
} /* End setup() */
@@ -345,13 +349,13 @@
tst_brkm(TBROK, cleanup,
"open(2) on t_file failed, errno=%d : %s",
errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/* Close the file created above */
if (close(fildes) == -1) {
tst_brkm(TBROK, cleanup,
"close(t_file) Failed, errno=%d : %s",
errno, strerror(errno));
- /*NOTREACHED*/}
+ }
return 0;
}
diff --git a/testcases/kernel/syscalls/truncate/truncate04.c b/testcases/kernel/syscalls/truncate/truncate04.c
index 5038734..0819404 100644
--- a/testcases/kernel/syscalls/truncate/truncate04.c
+++ b/testcases/kernel/syscalls/truncate/truncate04.c
@@ -106,7 +106,11 @@
char *file_name; /* testfile name */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -152,7 +156,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -170,7 +174,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/umask/umask01.c b/testcases/kernel/syscalls/umask/umask01.c
index 430b2d8..5b981c6 100644
--- a/testcases/kernel/syscalls/umask/umask01.c
+++ b/testcases/kernel/syscalls/umask/umask01.c
@@ -135,7 +135,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/umask/umask02.c b/testcases/kernel/syscalls/umask/umask02.c
index 3d6ee91..e393fe8 100644
--- a/testcases/kernel/syscalls/umask/umask02.c
+++ b/testcases/kernel/syscalls/umask/umask02.c
@@ -72,7 +72,7 @@
if ((msg = parse_opts(argc, argv, NULL, NULL)) !=
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+ }
setup();
@@ -95,7 +95,7 @@
"values");
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
@@ -129,4 +129,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/umask/umask03.c b/testcases/kernel/syscalls/umask/umask03.c
index 48ae193..8a127de 100644
--- a/testcases/kernel/syscalls/umask/umask03.c
+++ b/testcases/kernel/syscalls/umask/umask03.c
@@ -75,10 +75,16 @@
unsigned low9mode;
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(argc, argv, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ if ((msg = parse_opts(argc, argv, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup(); /* global setup */
@@ -106,7 +112,7 @@
"mask didnot take",
low9mode,
(~mskval & 0777));
- /*NOTREACHED*/}
+ }
}
}
close(fildes);
@@ -116,7 +122,7 @@
"previous value for all masks");
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
diff --git a/testcases/kernel/syscalls/umount/umount01.c b/testcases/kernel/syscalls/umount/umount01.c
index 66ac1a2..825a17f 100644
--- a/testcases/kernel/syscalls/umount/umount01.c
+++ b/testcases/kernel/syscalls/umount/umount01.c
@@ -178,7 +178,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -193,7 +193,7 @@
if (Fstype != NULL) {
free(Fstype);
}
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* make a temp directory */
diff --git a/testcases/kernel/syscalls/umount/umount02.c b/testcases/kernel/syscalls/umount/umount02.c
index d20711e..349a337 100644
--- a/testcases/kernel/syscalls/umount/umount02.c
+++ b/testcases/kernel/syscalls/umount/umount02.c
@@ -231,7 +231,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -348,7 +348,7 @@
if (Type != NULL) {
free(Type);
}
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* make a temp directory */
diff --git a/testcases/kernel/syscalls/umount/umount03.c b/testcases/kernel/syscalls/umount/umount03.c
index 21fd504..d449af6 100644
--- a/testcases/kernel/syscalls/umount/umount03.c
+++ b/testcases/kernel/syscalls/umount/umount03.c
@@ -182,7 +182,7 @@
/* Switch to nobody user */
if ((ltpuser = getpwnam(nobody_uid)) == NULL) {
- tst_brkm(TBROK, tst_exit, "\"nobody\" user"
+ tst_brkm(TBROK, NULL, "\"nobody\" user"
"not present");
}
if (setuid(ltpuser->pw_uid) == -1) {
@@ -221,7 +221,7 @@
/* cleanup and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -239,7 +239,7 @@
if (Type != NULL) {
free(Type);
}
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
/* Switch to nobody user */
@@ -247,13 +247,13 @@
if (Type != NULL) {
free(Type);
}
- tst_brkm(TBROK, tst_exit, "\"nobody\" user not present");
+ tst_brkm(TBROK, NULL, "\"nobody\" user not present");
}
if (seteuid(ltpuser->pw_uid) == -1) {
if (Type != NULL) {
free(Type);
}
- tst_brkm(TBROK, tst_exit, "setuid failed to set the "
+ tst_brkm(TBROK, NULL, "setuid failed to set the "
"effective uid to %d", ltpuser->pw_uid);
}
/* make a temp directory */
diff --git a/testcases/kernel/syscalls/uname/uname01.c b/testcases/kernel/syscalls/uname/uname01.c
index 53e7a95..fb38f75 100644
--- a/testcases/kernel/syscalls/uname/uname01.c
+++ b/testcases/kernel/syscalls/uname/uname01.c
@@ -136,7 +136,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/uname/uname02.c b/testcases/kernel/syscalls/uname/uname02.c
index fb8c91d..7b3fbc0 100644
--- a/testcases/kernel/syscalls/uname/uname02.c
+++ b/testcases/kernel/syscalls/uname/uname02.c
@@ -74,10 +74,16 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup(); /* global setup */
@@ -114,7 +120,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
diff --git a/testcases/kernel/syscalls/uname/uname03.c b/testcases/kernel/syscalls/uname/uname03.c
index 8c52aa8..0c6f754 100644
--- a/testcases/kernel/syscalls/uname/uname03.c
+++ b/testcases/kernel/syscalls/uname/uname03.c
@@ -75,8 +75,12 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
+ }
setup(); /* global setup */
@@ -85,7 +89,7 @@
if ((buf = (struct utsname *)malloc((size_t)
sizeof(struct utsname))) == NULL) {
tst_brkm(TBROK, cleanup, "malloc failed for buf");
- /*NOTREACHED*/}
+ }
/* The following loop checks looping state if -i option given */
@@ -121,7 +125,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
diff --git a/testcases/kernel/syscalls/unlink/unlink05.c b/testcases/kernel/syscalls/unlink/unlink05.c
index 2c4b8b0..545645d 100644
--- a/testcases/kernel/syscalls/unlink/unlink05.c
+++ b/testcases/kernel/syscalls/unlink/unlink05.c
@@ -139,7 +139,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/unlinkat/unlinkat01.c b/testcases/kernel/syscalls/unlinkat/unlinkat01.c
index 5d5945b..5fb89dc 100644
--- a/testcases/kernel/syscalls/unlinkat/unlinkat01.c
+++ b/testcases/kernel/syscalls/unlinkat/unlinkat01.c
@@ -105,7 +105,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/unshare/unshare01.c b/testcases/kernel/syscalls/unshare/unshare01.c
index 01aea64..2a2c968 100644
--- a/testcases/kernel/syscalls/unshare/unshare01.c
+++ b/testcases/kernel/syscalls/unshare/unshare01.c
@@ -1,27 +1,27 @@
-/********************************************************************************/
-/* Copyright (c) Crackerjack Project., 2007 */
-/* */
-/* This program is free software; you can redistribute it and/or modify */
-/* it under the terms of the GNU General Public License as published by */
-/* the Free Software Foundation; either version 2 of the License, or */
-/* (at your option) any later version. */
-/* */
-/* This program is distributed in the hope that it will be useful, */
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */
-/* the GNU General Public License for more details. */
-/* */
-/* You should have received a copy of the GNU General Public License */
-/* along with this program; if not, write to the Free Software */
-/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* */
-/****************************************************************************** */
-/****************************************************************************** */
-/* */
-/* File: unshare01.c */
-/* */
-/* Description: This tests the unshare() syscall. */
-/* unshare() allows a process to disassociate parts of its */
+/*************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007 */
+/* */
+/* This program is free software; you can redistribute it and/or modify */
+/* it under the terms of the GNU General Public License as published by */
+/* the Free Software Foundation; either version 2 of the License, or */
+/* (at your option) any later version. */
+/* */
+/* This program is distributed in the hope that it will be useful, */
+/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
+/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */
+/* the GNU General Public License for more details. */
+/* */
+/* You should have received a copy of the GNU General Public License */
+/* along with this program; if not, write to the Free Software */
+/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA*/
+/* */
+/*************************************************************************/
+/*************************************************************************/
+/* */
+/* File: unshare01.c */
+/* */
+/* Description: This tests the unshare() syscall. */
+/* unshare() allows a process to disassociate parts of its */
/* execution context that are currently being shared with other */
/* processes. Part of the execution context, such as the namespace */
/* ,is shared implicitly when a new process is created using */
@@ -31,7 +31,7 @@
/* */
/* The main use of unshare() is to allow a process to control its */
/* shared execution context without creating a new process. */
-/* */
+/* */
/* */
/* The flags argument is a bit mask that specifies which parts of */
/* the execution context should be unshared. This argument is */
@@ -57,21 +57,21 @@
/* */
/* If flags is specified as zero, then unshare() is a no-op; no */
/* changes are made to the calling process's execution context. */
-/* */
-/* Usage: <for command-line> */
-/* unshare01 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
-/* where, -c n : Run n copies concurrently. */
-/* -e : Turn on errno logging. */
-/* -i n : Execute test n times. */
-/* -I x : Execute test for x seconds. */
-/* -P x : Pause for x seconds between iterations. */
-/* -t : Turn on syscall timing. */
-/* */
-/* Total Tests: 1 */
-/* */
-/* Test Name: unshare01 */
-/* History: Porting from Crackerjack to LTP is done by */
-/* Manas Kumar Nayak maknayak@in.ibm.com> */
+/* */
+/* Usage: <for command-line> */
+/* unshare01 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
+/* where, -c n : Run n copies concurrently. */
+/* -e : Turn on errno logging. */
+/* -i n : Execute test n times. */
+/* -I x : Execute test for x seconds. */
+/* -P x : Pause for x seconds between iterations. */
+/* -t : Turn on syscall timing. */
+/* */
+/* Total Tests: 1 */
+/* */
+/* Test Name: unshare01 */
+/* History: Porting from Crackerjack to LTP is done by */
+/* Manas Kumar Nayak maknayak@in.ibm.com> */
/********************************************************************************/
#include <stdio.h>
@@ -95,168 +95,205 @@
#include "config.h"
/* Extern Global Variables */
-extern int Tst_count; /* counter for tst_xxx routines. */
-extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */
+extern int Tst_count; /* counter for tst_xxx routines. */
+extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */
/* Global Variables */
char *TCID = "unshare01"; /* Test program identifier.*/
int testno;
-int TST_TOTAL =1; /* total number of tests in this file. */
+int TST_TOTAL =1; /* total number of tests in this file. */
#ifdef HAVE_UNSHARE
/* Extern Global Functions */
/******************************************************************************/
-/* */
-/* Function: cleanup */
-/* */
+/* */
+/* Function: cleanup */
+/* */
/* Description: Performs all one time clean up for this test on successful */
-/* completion, premature exit or failure. Closes all temporary */
-/* files, removes all temporary directories exits the test with */
-/* appropriate TEST_RETURNurn code by calling tst_exit() function. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
+/* completion, premature exit or failure. Closes all temporary */
+/* files, removes all temporary directories exits the test with */
+/* appropriate TEST_RETURNurn code by calling tst_exit() function. */
+/* */
+/* Input: None. */
+/* */
+/* Output: None. */
+/* */
/* Return: On failure - Exits calling tst_exit(). Non '0' TEST_RETURNurn code. */
-/* On success - Exits calling tst_exit(). With '0' TEST_RETURNurn code. */
-/* */
+/* On success - Exits calling tst_exit(). With '0' TEST_RETURNurn code. */
+/* */
/******************************************************************************/
extern void cleanup() {
- /* Remove tmp dir and all files in it */
- TEST_CLEANUP;
- tst_rmdir();
-
- /* Exit with appropriate TEST_RETURNurn code. */
- tst_exit();
+ /* Remove tmp dir and all files in it */
+ TEST_CLEANUP;
+ tst_rmdir();
}
/* Local Functions */
/******************************************************************************/
-/* */
-/* Function: setup */
-/* */
+/* */
+/* Function: setup */
+/* */
/* Description: Performs all one time setup for this test. This function is */
-/* typically used to capture signals, create temporary dirs */
-/* and temporary files that may be used in the course of this */
-/* test. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits by calling cleanup(). */
-/* On success - TEST_RETURNurns 0. */
-/* */
+/* typically used to capture signals, create temporary dirs */
+/* and temporary files that may be used in the course of this */
+/* test. */
+/* */
+/* Input: None. */
+/* */
+/* Output: None. */
+/* */
+/* Return: On failure - Exits by calling cleanup(). */
+/* On success - TEST_RETURNurns 0. */
+/* */
/******************************************************************************/
void setup() {
- /* Capture signals if any */
- /* Create temporary directories */
- TEST_PAUSE;
- tst_tmpdir();
+ /* Capture signals if any */
+ /* Create temporary directories */
+ TEST_PAUSE;
+ tst_tmpdir();
}
int main(int ac, char **av) {
- pid_t pid1;
- int lc; /* loop counter */
- char *msg; /* message TEST_RETURNurned from parse_opts */
+ pid_t pid1;
+ int lc; /* loop counter */
+ int rval;
+ char *msg; /* message TEST_RETURNurned from parse_opts */
- /* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
- tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
+ /* parse standard options */
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- setup();
+ setup();
- /* Check looping state if -i option given */
- for (lc = 0; TEST_LOOPING(lc); ++lc) {
- Tst_count = 0;
- for (testno = 0; testno < TST_TOTAL; ++testno) {
+ /* Check looping state if -i option given */
+ for (lc = 0; TEST_LOOPING(lc); ++lc) {
+ Tst_count = 0;
+ for (testno = 0; testno < TST_TOTAL; ++testno) {
- /*
- *fork a child process;testing which one is a child or a parent;
- * */
- TEST(pid1=fork()); //call to fork()
+ TEST(pid1 = fork()); //call to fork()
if (TEST_RETURN == -1) {
- tst_resm(TFAIL|TTERRNO, "fork() failed.");
- cleanup();
- tst_exit();
+ tst_brkm(TFAIL|TTERRNO, cleanup, "fork failed");
} else if (TEST_RETURN == 0) {
- TEST_RETURN = unshare(CLONE_FS);
- if (TEST_RETURN == 0)
- tst_resm(TPASS,
- "unshare with CLONE_FILES call "
- "succeeded");
- else if (TEST_RETURN == -1) {
- if (errno == ENOSYS)
- tst_resm(TCONF,
- "unshare is not "
- "implemented in kernel."
- );
- else
- tst_resm(TFAIL|TERRNO,
- "unshare failed.");
- }
- tst_exit();
- }else{
- }
-
- TEST(pid1=fork()); //call to fork()
- if (TEST_RETURN == -1) {
- tst_resm(TFAIL|TTERRNO, "fork() failed.");
- cleanup();
- tst_exit();
- } else if (TEST_RETURN == 0) {
- TEST_RETURN = unshare(CLONE_FS);
- if (TEST_RETURN == 0)
- tst_resm(TPASS,
- "unshare with CLONE_FS call "
- "succeeded");
- else if (TEST_RETURN == -1) {
- if (errno == ENOSYS)
- tst_resm(TCONF,
- "unshare is not "
- "implemented in kernel."
- );
- else
- tst_resm(TFAIL|TERRNO,
- "unshare failed 2.");
- }
- tst_exit();
- }else{
- }
-
- TEST(pid1=fork()); //call to fork()
- if (TEST_RETURN == -1) {
- tst_resm(TFAIL|TTERRNO, "fork() failed.");
- cleanup();
- tst_exit();
- } else if (TEST_RETURN == 0) {
- TEST_RETURN = unshare(CLONE_NEWNS);
+ TEST(unshare(CLONE_FS));
if (TEST_RETURN == 0) {
- tst_resm(TPASS,
- "unshare call with CLONE_NEWNS "
- "succeeded");
+ printf("unshare with CLONE_FILES call "
+ "succeeded\n");
+ rval = 0;
} else if (TEST_RETURN == -1) {
- if (errno == ENOSYS)
- tst_resm(TCONF,
- "unshare is not "
- "implemented in kernel."
- );
- else
- tst_resm(TFAIL|TERRNO,
- "unshare failed 2.");
+ if (TEST_ERRNO == ENOSYS) {
+ rval = 1;
+ } else {
+ errno = TEST_ERRNO;
+ perror("unshare failed");
+ rval = 2;
+ }
}
- tst_exit();
- }else{
+ exit(rval);
+ } else {
+ if (wait(&rval) == -1) {
+ tst_brkm(TBROK|TERRNO, cleanup,
+ "wait failed");
+ }
+ if (rval != 0 && WIFEXITED(rval)) {
+ switch (WEXITSTATUS(rval)) {
+ case 1:
+ tst_brkm(TCONF, cleanup,
+ "unshare not supported in "
+ "kernel");
+ break;
+ default:
+ tst_brkm(TFAIL, cleanup,
+ "unshare failed");
+ break;
+ }
+ }
}
+ pid1 = fork();
+ if (TEST_RETURN == -1) {
+ tst_brkm(TFAIL|TERRNO, cleanup,
+ "fork failed");
+ } else if (pid1 == 0) {
+ TEST(unshare(CLONE_FS));
+ if (TEST_RETURN == 0) {
+ printf("unshare with CLONE_FS call "
+ "succeeded\n");
+ rval = 0;
+ } else if (TEST_RETURN == -1) {
+ if (TEST_ERRNO == ENOSYS) {
+ rval = 1;
+ } else {
+ errno = TEST_ERRNO;
+ perror("unshare failed");
+ rval = 2;
+ }
+ }
+ exit(rval);
+ } else {
+ if (wait(&rval) == -1) {
+ tst_brkm(TBROK|TERRNO, cleanup,
+ "wait failed");
+ }
+ if (rval != 0 && WIFEXITED(rval)) {
+ switch (WEXITSTATUS(rval)) {
+ case 1:
+ tst_brkm(TCONF, cleanup,
+ "unshare not supported in "
+ "kernel");
+ break;
+ default:
+ tst_brkm(TFAIL, cleanup,
+ "unshare failed");
+ break;
+ }
+ }
+ }
- }
+ pid1 = fork();
+ if (pid1 == -1) {
+ tst_brkm(TFAIL|TERRNO, cleanup,
+ "fork() failed.");
+ } else if (TEST_RETURN == 0) {
+ TEST(unshare(CLONE_NEWNS));
+ if (TEST_RETURN == 0) {
+ printf("unshare call with CLONE_NEWNS "
+ "succeeded\n");
+ rval = 0;
+ } else if (TEST_RETURN == -1) {
+ if (TEST_ERRNO == ENOSYS) {
+ rval = 1;
+ } else {
+ errno = TEST_ERRNO;
+ perror("unshare failed");
+ rval = 2;
+ }
+ }
+ } else {
+ if (wait(&rval) == -1) {
+ tst_brkm(TBROK|TERRNO, cleanup,
+ "wait failed");
+ }
+ if (rval != 0 && WIFEXITED(rval)) {
+ switch (WEXITSTATUS(rval)) {
+ case 1:
+ tst_brkm(TCONF, cleanup,
+ "unshare not supported in "
+ "kernel");
+ break;
+ default:
+ tst_brkm(TFAIL, cleanup,
+ "unshare failed");
+ break;
+ }
- }
+ }
+
+ }
+
+ }
+
+ }
cleanup();
tst_exit();
}
diff --git a/testcases/kernel/syscalls/unshare/unshare02.c b/testcases/kernel/syscalls/unshare/unshare02.c
index 09fdf3c..c97e65b 100644
--- a/testcases/kernel/syscalls/unshare/unshare02.c
+++ b/testcases/kernel/syscalls/unshare/unshare02.c
@@ -1,41 +1,41 @@
/******************************************************************************/
-/* Copyright (c) Crackerjack Project., 2007 */
-/* */
+/* Copyright (c) Crackerjack Project., 2007 */
+/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
-/* the Free Software Foundation; either version 2 of the License, or */
-/* (at your option) any later version. */
-/* */
-/* This program is distributed in the hope that it will be useful, */
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */
-/* the GNU General Public License for more details. */
-/* */
-/* You should have received a copy of the GNU General Public License */
-/* along with this program; if not, write to the Free Software */
+/* the Free Software Foundation; either version 2 of the License, or */
+/* (at your option) any later version. */
+/* */
+/* This program is distributed in the hope that it will be useful, */
+/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
+/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */
+/* the GNU General Public License for more details. */
+/* */
+/* You should have received a copy of the GNU General Public License */
+/* along with this program; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* */
+/* */
/******************************************************************************/
/******************************************************************************/
-/* */
-/* File: unshare02.c */
-/* */
-/* Description: This tests the unshare error() syscall */
-/* */
-/* Usage: <for command-line> */
-/* unshare02 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
-/* where, -c n : Run n copies concurrently. */
-/* -e : Turn on errno logging. */
-/* -i n : Execute test n times. */
-/* -I x : Execute test for x seconds. */
-/* -P x : Pause for x seconds between iterations. */
-/* -t : Turn on syscall timing. */
-/* */
-/* Total Tests: 2 */
-/* */
-/* Test Name: unshare02 */
-/* History: Porting from Crackerjack to LTP is done by */
-/* Manas Kumar Nayak maknayak@in.ibm.com> */
+/* */
+/* File: unshare02.c */
+/* */
+/* Description: This tests the unshare error() syscall */
+/* */
+/* Usage: <for command-line> */
+/* unshare02 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
+/* where, -c n : Run n copies concurrently. */
+/* -e : Turn on errno logging. */
+/* -i n : Execute test n times. */
+/* -I x : Execute test for x seconds. */
+/* -P x : Pause for x seconds between iterations. */
+/* -t : Turn on syscall timing. */
+/* */
+/* Total Tests: 2 */
+/* */
+/* Test Name: unshare02 */
+/* History: Porting from Crackerjack to LTP is done by */
+/* Manas Kumar Nayak maknayak@in.ibm.com> */
/******************************************************************************/
#include <stdio.h>
@@ -59,144 +59,168 @@
#include "config.h"
/* Extern Global Variables */
-extern int Tst_count; /* counter for tst_xxx routines. */
-extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */
+extern int Tst_count; /* counter for tst_xxx routines. */
+extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */
/* Global Variables */
char *TCID = "unshare02"; /* Test program identifier.*/
int testno;
-int TST_TOTAL = 2; /* total number of tests in this file. */
+int TST_TOTAL = 2; /* total number of tests in this file. */
#ifdef HAVE_UNSHARE
/* Extern Global Functions */
/******************************************************************************/
-/* */
-/* Function: cleanup */
-/* */
+/* */
+/* Function: cleanup */
+/* */
/* Description: Performs all one time clean up for this test on successful */
-/* completion, premature exit or failure. Closes all temporary */
-/* files, removes all temporary directories exits the test with */
-/* appropriate TEST_RETURNurn code by calling tst_exit() function. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
+/* completion, premature exit or failure. Closes all temporary */
+/* files, removes all temporary directories exits the test with */
+/* appropriate TEST_RETURNurn code by calling tst_exit() function. */
+/* */
+/* Input: None. */
+/* */
+/* Output: None. */
+/* */
/* Return: On failure - Exits calling tst_exit(). Non '0' TEST_RETURNurn code. */
-/* On success - Exits calling tst_exit(). With '0' TEST_RETURNurn code. */
-/* */
+/* On success - Exits calling tst_exit(). With '0' TEST_RETURNurn code. */
+/* */
/******************************************************************************/
extern void cleanup() {
- /* Remove tmp dir and all files in it */
- TEST_CLEANUP;
- tst_rmdir();
+ /* Remove tmp dir and all files in it */
+ TEST_CLEANUP;
+ tst_rmdir();
- /* Exit with appropriate TEST_RETURNurn code. */
- tst_exit();
+ /* Exit with appropriate TEST_RETURNurn code. */
+ tst_exit();
}
/* Local Functions */
/******************************************************************************/
-/* */
-/* Function: setup */
-/* */
+/* */
+/* Function: setup */
+/* */
/* Description: Performs all one time setup for this test. This function is */
-/* typically used to capture signals, create temporary dirs */
-/* and temporary files that may be used in the course of this */
-/* test. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits by calling cleanup(). */
-/* On success - TEST_RETURNurns 0. */
-/* */
+/* typically used to capture signals, create temporary dirs */
+/* and temporary files that may be used in the course of this */
+/* test. */
+/* */
+/* Input: None. */
+/* */
+/* Output: None. */
+/* */
+/* Return: On failure - Exits by calling cleanup(). */
+/* On success - TEST_RETURNurns 0. */
+/* */
/******************************************************************************/
void setup() {
- /* Capture signals if any */
- /* Create temporary directories */
- TEST_PAUSE;
- tst_tmpdir();
+ /* Capture signals if any */
+ /* Create temporary directories */
+ TEST_PAUSE;
+ tst_tmpdir();
}
int main(int ac, char **av) {
- pid_t pid1;
- int lc; /* loop counter */
- char *msg; /* message TEST_RETURNurned from parse_opts */
+ pid_t pid1;
+ int lc; /* loop counter */
+ int rval;
+ char *msg; /* message TEST_RETURNurned from parse_opts */
- /* parse standard options */
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
- tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
+ /* parse standard options */
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- setup();
+ setup();
- /* Check looping state if -i option given */
- for (lc = 0; TEST_LOOPING(lc); ++lc) {
- Tst_count = 0;
- for (testno = 0; testno < TST_TOTAL; ++testno) {
+ /* Check looping state if -i option given */
+ for (lc = 0; TEST_LOOPING(lc); ++lc) {
+ Tst_count = 0;
+ for (testno = 0; testno < TST_TOTAL; ++testno) {
- /*
- *fork a child process;testing which one is a child or a parent;
- * */
- TEST(pid1=fork()); //call to fork()
+ TEST(pid1 = fork()); //call to fork()
if (TEST_RETURN == -1) {
- tst_resm(TFAIL|TTERRNO,
+ tst_brkm(TFAIL|TTERRNO, cleanup,
"fork() failed.");
- cleanup();
- tst_exit();
} else if (TEST_RETURN == 0) {
TEST_RETURN = unshare(-1);
- if (TEST_RETURN == 0)
- tst_resm(TFAIL,
- "Call unexpectedly succeeded.");
- else if (TEST_RETURN == -1) {
- if (errno == EINVAL)
- tst_resm(TPASS|TERRNO,
- "Expect EINVAL.");
- else if (errno == ENOSYS)
- tst_resm(TCONF,
- "unshare is not "
- "implemented in kernel."
- );
- else
- tst_resm(TFAIL|TERRNO,
- "Test failed.");
+ if (TEST_RETURN == 0) {
+ printf("Call unexpectedly succeeded\n");
+ rval = 1;
+ } else if (TEST_RETURN == -1) {
+ if (errno == EINVAL) {
+ printf("Got EINVAL\n");
+ rval = 0;
+ } else if (errno == ENOSYS) {
+ rval = 1;
+ } else {
+ perror("unshare failed");
+ rval = 2;
+ }
}
- tst_exit();
+ exit(rval);
+ } else {
+ if (wait(&rval) == -1) {
+ tst_brkm(TBROK|TERRNO, cleanup,
+ "wait failed");
+ }
+ if (rval != 0 && WIFEXITED(rval)) {
+ switch (WEXITSTATUS(rval)) {
+ case 1:
+ tst_brkm(TBROK, cleanup,
+ "unshare call unsupported "
+ "in kernel");
+ break;
+ case 2:
+ tst_brkm(TFAIL, cleanup,
+ "unshare call failed");
+ break;
+ }
+ }
}
TEST(pid1=fork()); //call to fork()
if (pid1 == -1) {
- tst_resm(TFAIL|TTERRNO,
+ tst_brkm(TFAIL|TTERRNO, cleanup,
"fork() failed.");
- cleanup();
- tst_exit();
} else if (TEST_RETURN == 0) {
TEST_RETURN = unshare((int)NULL);
- if (TEST_RETURN == 0)
+ if (TEST_RETURN == 0) {
tst_resm(TPASS, "Call succeeded");
- else if (TEST_RETURN == -1) {
+ rval = 0;
+ } else if (TEST_RETURN == -1) {
if (errno == ENOSYS)
- tst_resm(TCONF,
- "unshare is not "
- "implemented in kernel."
- );
- else
- tst_resm(TFAIL|TERRNO,
- "Test failed 2. ");
+ rval = 1;
+ else {
+ perror("unshare failed");
+ rval = 2;
+ }
}
- tst_exit();
- }
+ exit(rval);
+ } else {
+ if (wait(&rval) == -1) {
+ tst_brkm(TBROK|TERRNO, cleanup,
+ "wait failed");
+ }
+ if (rval != 0 && WIFEXITED(rval)) {
+ switch (WEXITSTATUS(rval)) {
+ case 1:
+ tst_brkm(TBROK, cleanup,
+ "unshare call unsupported "
+ "in kernel");
+ break;
+ case 2:
+ tst_brkm(TFAIL, cleanup,
+ "unshare call failed");
+ break;
+ }
+ }
+ }
-
- }
+ }
}
cleanup();
- tst_exit();
+ tst_exit();
}
#else
int main(void)
diff --git a/testcases/kernel/syscalls/ustat/ustat01.c b/testcases/kernel/syscalls/ustat/ustat01.c
index 2d293e3..dbb9243 100644
--- a/testcases/kernel/syscalls/ustat/ustat01.c
+++ b/testcases/kernel/syscalls/ustat/ustat01.c
@@ -88,9 +88,15 @@
char *msg;
/*parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(argc, argv, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(argc, argv, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -131,19 +137,19 @@
/* Allocate memory for stat and ustat structure variables */
if ((buf = (struct stat *)malloc(sizeof(struct stat))) == NULL) {
- tst_brkm(TBROK, tst_exit, "Failed to allocate Memory");
+ tst_brkm(TBROK, NULL, "Failed to allocate Memory");
}
if ((ubuf = (struct ustat *)malloc(sizeof(struct ustat))) == NULL) {
free(buf);
- tst_brkm(TBROK, tst_exit, "Failed to allocate Memory");
+ tst_brkm(TBROK, NULL, "Failed to allocate Memory");
}
/*Find out device number for a file-system */
if (stat("/", buf) != 0) {
free(buf);
free(ubuf);
- tst_brkm(TBROK, tst_exit, "Couldn't find device number");
+ tst_brkm(TBROK, NULL, "Couldn't find device number");
}
dev_num = buf->st_dev;
diff --git a/testcases/kernel/syscalls/ustat/ustat02.c b/testcases/kernel/syscalls/ustat/ustat02.c
index d72415d..3741d20 100644
--- a/testcases/kernel/syscalls/ustat/ustat02.c
+++ b/testcases/kernel/syscalls/ustat/ustat02.c
@@ -110,9 +110,15 @@
char *msg; /* message returned from parse_opts */
/* parse standard options */
+<<<<<<< HEAD
if ((msg = parse_opts(ac, av, NULL, NULL))
!= NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL))
+ != NULL) {
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
/* perform global setup for test */
@@ -152,7 +158,7 @@
/*Clean up and exit */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /*End of main */
/* setup() - performs all ONE TIME setup for this test */
@@ -171,19 +177,19 @@
/* Allocating memory for ustat and stat structure variables */
if ((ubuf = (struct ustat *)malloc(sizeof(struct ustat))) == NULL) {
- tst_brkm(TBROK, tst_exit, "Failed to allocate Memory");
+ tst_brkm(TBROK, NULL, "Failed to allocate Memory");
}
if ((buf = (struct stat *)malloc(sizeof(struct stat))) == NULL) {
free(ubuf);
- tst_brkm(TBROK, tst_exit, "Failed to allocate Memory");
+ tst_brkm(TBROK, NULL, "Failed to allocate Memory");
}
/* Finding out a valid device number */
if (stat("/", buf) != 0) {
free(buf);
free(ubuf);
- tst_brkm(TBROK, tst_exit, "stat(2) failed. Exiting without"
+ tst_brkm(TBROK, NULL, "stat(2) failed. Exiting without"
"invoking ustat(2)");
}
dev_num[1] = buf->st_dev;
diff --git a/testcases/kernel/syscalls/utime/utime01.c b/testcases/kernel/syscalls/utime/utime01.c
index 0c30475..55b5d2c 100644
--- a/testcases/kernel/syscalls/utime/utime01.c
+++ b/testcases/kernel/syscalls/utime/utime01.c
@@ -105,7 +105,11 @@
time_t pres_time; /* file modification/access/present time */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -163,7 +167,7 @@
"failed to get present time "
"after utime, error=%d",
errno);
- /*NOTREACHED*/}
+ }
/*
* Get the modification and access times of
@@ -173,7 +177,7 @@
tst_brkm(TFAIL, cleanup, "stat(2) of "
"%s failed, error:%d",
TEMP_FILE, TEST_ERRNO);
- /*NOTREACHED*/}
+ }
modf_time = stat_buf.st_mtime;
access_time = stat_buf.st_atime;
@@ -199,7 +203,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
@@ -233,20 +237,20 @@
tst_brkm(TBROK, cleanup,
"creat(%s, %#o) Failed, errno=%d :%s",
TEMP_FILE, FILE_MODE, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/* Close the temporary file created */
if (close(fildes) < 0) {
tst_brkm(TBROK, cleanup,
"close(%s) Failed, errno=%d : %s:",
TEMP_FILE, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/* Get the current time */
if ((curr_time = time(&tloc)) < 0) {
tst_brkm(TBROK, cleanup,
"time() failed to get current time, errno=%d", errno);
- /*NOTREACHED*/}
+ }
/*
* Sleep for a second so that mod time and access times will be
diff --git a/testcases/kernel/syscalls/utime/utime02.c b/testcases/kernel/syscalls/utime/utime02.c
index 284802d..cfdbbbe 100644
--- a/testcases/kernel/syscalls/utime/utime02.c
+++ b/testcases/kernel/syscalls/utime/utime02.c
@@ -110,7 +110,11 @@
time_t pres_time; /* file modification/access/present time */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -168,7 +172,7 @@
"failed to get present time "
"after utime, error=%d",
errno);
- /*NOTREACHED*/}
+ }
/*
* Get the modification and access times of
@@ -178,7 +182,7 @@
tst_brkm(TFAIL, cleanup, "stat(2) of "
"%s failed, errno:%d",
TEMP_FILE, TEST_ERRNO);
- /*NOTREACHED*/}
+ }
modf_time = stat_buf.st_mtime;
access_time = stat_buf.st_atime;
@@ -204,7 +208,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -223,7 +227,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
@@ -247,20 +251,20 @@
tst_brkm(TBROK, cleanup,
"creat(%s, %#o) Failed, errno=%d :%s",
TEMP_FILE, FILE_MODE, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/* Close the temporary file created */
if (close(fildes) < 0) {
tst_brkm(TBROK, cleanup,
"close(%s) Failed, errno=%d : %s:",
TEMP_FILE, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/* Get the current time */
if ((curr_time = time(&tloc)) < 0) {
tst_brkm(TBROK, cleanup,
"time() failed to get current time, errno=%d", errno);
- /*NOTREACHED*/}
+ }
/*
* Sleep for a second so that mod time and access times will be
diff --git a/testcases/kernel/syscalls/utime/utime03.c b/testcases/kernel/syscalls/utime/utime03.c
index 3cca5d6..eb2c1ff 100644
--- a/testcases/kernel/syscalls/utime/utime03.c
+++ b/testcases/kernel/syscalls/utime/utime03.c
@@ -121,7 +121,11 @@
pid_t pid;
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -197,7 +201,7 @@
"present time after "
"utime, error=%d",
errno);
- /*NOTREACHED*/}
+ }
/*
* Get the modification and access
@@ -209,7 +213,7 @@
"stat(2) of %s failed, "
"error:%d", TEMP_FILE,
TEST_ERRNO);
- /*NOTREACHED*/}
+ }
modf_time = stat_buf.st_mtime;
access_time = stat_buf.st_atime;
@@ -246,7 +250,7 @@
}
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -284,7 +288,7 @@
/* get the name of the temporary directory */
if ((tmpd = getcwd(tmpd, 0)) == NULL) {
- tst_brkm(TBROK, tst_exit, "getcwd failed");
+ tst_brkm(TBROK, NULL, "getcwd failed");
}
/* Creat a temporary file under above directory */
@@ -292,14 +296,14 @@
tst_brkm(TBROK, cleanup,
"creat(%s, %#o) Failed, errno=%d :%s",
TEMP_FILE, FILE_MODE, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/* Close the temporary file created */
if (close(fildes) < 0) {
tst_brkm(TBROK, cleanup,
"close(%s) Failed, errno=%d : %s:",
TEMP_FILE, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
/*
* Make sure that specified Mode permissions set as
@@ -309,7 +313,7 @@
tst_brkm(TBROK, cleanup,
"chmod(%s) Failed, errno=%d : %s:",
TEMP_FILE, errno, strerror(errno));
- /*NOTREACHED*/}
+ }
if (chmod(tmpd, 0711) != 0) {
tst_brkm(TBROK, cleanup, "chmod() failed");
@@ -318,7 +322,7 @@
if ((ltpuser = getpwnam(LTPUSER2)) == NULL) {
tst_brkm(TBROK, cleanup, "%s not found in /etc/passwd",
LTPUSER2);
- /*NOTREACHED*/}
+ }
/* get uid/gid of user accordingly */
user_uid = ltpuser->pw_uid;
@@ -331,13 +335,13 @@
if (chown(TEMP_FILE, user_uid, group_gid) < 0) {
tst_brkm(TBROK, cleanup, "chown() of %s failed, error %d",
TEMP_FILE, errno);
- /*NOTREACHED*/}
+ }
/* Get the current time */
if ((curr_time = time(&tloc)) < 0) {
tst_brkm(TBROK, cleanup,
"time() failed to get current time, errno=%d", errno);
- /*NOTREACHED*/}
+ }
/*
* Sleep for a second so that mod time and access times will be
diff --git a/testcases/kernel/syscalls/utime/utime04.c b/testcases/kernel/syscalls/utime/utime04.c
index dd6d372..f9141c1 100644
--- a/testcases/kernel/syscalls/utime/utime04.c
+++ b/testcases/kernel/syscalls/utime/utime04.c
@@ -104,7 +104,11 @@
/* file modification/access time */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -148,7 +152,7 @@
"stat(2) of %s failed, "
"error:%d", TEMP_FILE,
TEST_ERRNO);
- /*NOTREACHED*/}
+ }
modf_time = stat_buf.st_mtime;
access_time = stat_buf.st_atime;
@@ -172,7 +176,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
diff --git a/testcases/kernel/syscalls/utime/utime05.c b/testcases/kernel/syscalls/utime/utime05.c
index 18a3777..eb41bc1 100644
--- a/testcases/kernel/syscalls/utime/utime05.c
+++ b/testcases/kernel/syscalls/utime/utime05.c
@@ -110,7 +110,11 @@
/* file modification/access time */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -153,7 +157,7 @@
tst_brkm(TFAIL, cleanup, "stat(2) of "
"%s failed, error:%d",
TEMP_FILE, TEST_ERRNO);
- /*NOTREACHED*/}
+ }
modf_time = stat_buf.st_mtime;
access_time = stat_buf.st_atime;
@@ -177,7 +181,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ tst_exit();
} /* End main */
@@ -196,7 +200,7 @@
/* Switch to nobody user for correct error code collection */
if (geteuid() != 0) {
- tst_brkm(TBROK, tst_exit, "Test must be run as root");
+ tst_brkm(TBROK, NULL, "Test must be run as root");
}
ltpuser = getpwnam(nobody_uid);
if (setuid(ltpuser->pw_uid) == -1) {
diff --git a/testcases/kernel/syscalls/utime/utime06.c b/testcases/kernel/syscalls/utime/utime06.c
index fd120ef..84acb53 100644
--- a/testcases/kernel/syscalls/utime/utime06.c
+++ b/testcases/kernel/syscalls/utime/utime06.c
@@ -137,7 +137,11 @@
int pid;
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -153,11 +157,11 @@
if (pid == -1) {
tst_brkm(TBROK, cleanup, "fork() failed");
- /*NOTREACHED*/} else if (pid == 0) {
+ } else if (pid == 0) {
if ((ltpuser = getpwnam(LTPUSER1)) == NULL) {
tst_brkm(TBROK, cleanup, "%s not found in /etc/passwd",
LTPUSER1);
- /*NOTREACHED*/}
+ }
/* get uid of user */
user_uid = ltpuser->pw_uid;
@@ -219,7 +223,7 @@
}
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
@@ -291,7 +295,7 @@
if ((ltpuser = getpwnam(LTPUSER2)) == NULL) {
tst_brkm(TBROK, cleanup, "%s not found in /etc/passwd",
LTPUSER2);
- /*NOTREACHED*/}
+ }
/* get uid/gid of user accordingly */
user_uid = ltpuser->pw_uid;
@@ -300,7 +304,7 @@
if (chown(TEMP_FILE, user_uid, group_gid) < 0) {
tst_brkm(TBROK, cleanup, "chown() of %s failed, error %d",
TEMP_FILE, errno);
- /*NOTREACHED*/}
+ }
return 0;
} /* End of setup1 */
diff --git a/testcases/kernel/syscalls/utimes/utimes01.c b/testcases/kernel/syscalls/utimes/utimes01.c
index a38525f..8377780 100644
--- a/testcases/kernel/syscalls/utimes/utimes01.c
+++ b/testcases/kernel/syscalls/utimes/utimes01.c
@@ -241,6 +241,7 @@
* Execute system call
*/
memset(tv, 0, 2 * sizeof(struct timeval));
+<<<<<<< HEAD
tv[0].tv_sec = tc->a_sec;
tv[1].tv_sec = tc->m_sec;
TEST(len = strlen(fpath));
@@ -267,6 +268,34 @@
else
TEST(sys_ret = utimes(fpath, NULL));
}
+=======
+ tv[0].tv_sec = tc->a_sec;
+ tv[1].tv_sec = tc->m_sec;
+ TEST(len = strlen(fpath));
+ if (tc->ttype == FILE_NOT_EXIST) {
+ c = fpath[len - 1];
+ fpath[len - 1] = '\0';
+ }
+ errno = 0;
+ if (tc->ttype == NO_FNAME) {
+ /**
+ * Note (garrcoop):
+ *
+ * If you do NULL directly, then gcc [4.3] will complain when
+ * one specifies -Wnonnull in CPPFLAGS. This is a negative
+ * test, but let's not allow the compiler to complain about
+ * something trivial like this.
+ **/
+ const char *dummy = NULL;
+ TEST(sys_ret = utimes(dummy, tv));
+ }
+ else {
+ if (tc->user == NULL)
+ TEST(sys_ret = utimes(fpath, tv));
+ else
+ TEST(sys_ret = utimes(fpath, NULL));
+ }
+>>>>>>> master
sys_errno = errno;
if (tc->ttype == FILE_NOT_EXIST)
fpath[len - 1] = c;
@@ -315,6 +344,7 @@
int main(int ac, char **av) {
int result = RESULT_OK;
+<<<<<<< HEAD
int i;
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
@@ -341,6 +371,63 @@
i, (ret == 0) ? "OK" : "NG");
result |= ret;
}
+=======
+ int c;
+ int i;
+ int lc; /* loop counter */
+ char *msg; /* message returned from parse_opts */
+
+ struct option long_options[] = {
+ { "debug", no_argument, 0, 'd' },
+ { "help", no_argument, 0, 'h' },
+ { NULL, 0, NULL, 0 }
+ };
+
+ progname = strchr(av[0], '/');
+ progname = progname ? progname + 1 : av[0];
+
+ /* parse standard options */
+ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+ tst_exit();
+ }
+
+ setup();
+
+ /* Check looping state if -i option given */
+ for (lc = 0; TEST_LOOPING(lc); ++lc) {
+ Tst_count = 0;
+ for (testno = 0; testno < TST_TOTAL; ++testno) {
+ TEST(c = getopt_long(ac, av, "dh", long_options, NULL));
+ while (TEST_RETURN != -1) {
+ switch (c) {
+ case 'd':
+ opt_debug = 1;
+ break;
+ default:
+ usage(progname);
+
+ }
+ }
+
+
+ if (ac != optind) {
+ tst_resm(TINFO,"Options are not match.");
+ usage(progname);
+
+ }
+
+ /*
+ * Execute test
+ */
+ for (i = 0; i < (int)(sizeof(tcase) / sizeof(tcase[0])); i++) {
+ int ret;
+ tst_resm(TINFO,"(case%02d) START", i);
+ ret = do_test(&tcase[i]);
+ tst_resm(TINFO,"(case%02d) END => %s", i, (ret == 0) ? "OK" : "NG");
+ result |= ret;
+ }
+>>>>>>> master
/*
* Check results
diff --git a/testcases/kernel/syscalls/vfork/vfork01.c b/testcases/kernel/syscalls/vfork/vfork01.c
index 718c536..9ac3b1a 100644
--- a/testcases/kernel/syscalls/vfork/vfork01.c
+++ b/testcases/kernel/syscalls/vfork/vfork01.c
@@ -115,7 +115,11 @@
int exit_status; /* exit status of child process */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
@@ -299,7 +303,7 @@
/* Call cleanup() to undo setup done for the test. */
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
} /* End main */
/*
diff --git a/testcases/kernel/syscalls/vfork/vfork02.c b/testcases/kernel/syscalls/vfork/vfork02.c
index d9601f4..386d2f8 100644
--- a/testcases/kernel/syscalls/vfork/vfork02.c
+++ b/testcases/kernel/syscalls/vfork/vfork02.c
@@ -98,7 +98,11 @@
sigset_t PendSig; /* variable to hold pending signal */
/* Parse standard options given to run the test. */
+<<<<<<< HEAD
msg = parse_opts(ac, av, NULL, NULL);
+=======
+ msg = parse_opts(ac, av, (option_t *) NULL, NULL);
+>>>>>>> master
if (msg != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
diff --git a/testcases/kernel/syscalls/vhangup/vhangup01.c b/testcases/kernel/syscalls/vhangup/vhangup01.c
index eb6df06..1ac45fd 100644
--- a/testcases/kernel/syscalls/vhangup/vhangup01.c
+++ b/testcases/kernel/syscalls/vhangup/vhangup01.c
@@ -90,7 +90,7 @@
if ((pid = FORK_OR_VFORK()) < 0) {
tst_brkm(TFAIL, cleanup, "fork failed");
- /*NOTREACHED*/} else if (pid > 0) { /* parent */
+ } else if (pid > 0) { /* parent */
waitpid(pid, &status, 0);
_exit(0); /*
* Exit here and let the child clean up.
@@ -105,12 +105,12 @@
if (retval < 0) {
perror("setreuid");
tst_brkm(TFAIL, cleanup, "setreuid failed");
- /*NOTREACHED*/}
+ }
TEST(vhangup());
if (TEST_RETURN != -1) {
tst_brkm(TFAIL, cleanup, "vhangup() failed to "
"fail");
- /*NOTREACHED*/} else if (TEST_ERRNO == EPERM) {
+ } else if (TEST_ERRNO == EPERM) {
TEST_ERROR_LOG(TEST_ERRNO);
tst_resm(TPASS, "Got EPERM as expected.");
} else {
@@ -121,7 +121,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
@@ -155,4 +155,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/vhangup/vhangup02.c b/testcases/kernel/syscalls/vhangup/vhangup02.c
index 47afb3f..05ab94c 100644
--- a/testcases/kernel/syscalls/vhangup/vhangup02.c
+++ b/testcases/kernel/syscalls/vhangup/vhangup02.c
@@ -82,14 +82,14 @@
if ((pid = FORK_OR_VFORK()) < 0) {
tst_brkm(TFAIL, cleanup, "fork failed");
- /*NOTREACHED*/} else if (pid > 0) { /* parent */
+ } else if (pid > 0) { /* parent */
waitpid(pid, &status, 0);
_exit(0);
} else { /* child */
pid1 = setsid();
if (pid1 < 0) {
tst_brkm(TFAIL, cleanup, "setsid failed");
- /*NOTREACHED*/}
+ }
TEST(vhangup());
if (TEST_RETURN == -1) {
tst_resm(TFAIL, "vhangup() failed, errno:%d",
@@ -100,7 +100,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
@@ -131,4 +131,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/vmsplice/vmsplice01.c b/testcases/kernel/syscalls/vmsplice/vmsplice01.c
index 7340655..b4690b6 100644
--- a/testcases/kernel/syscalls/vmsplice/vmsplice01.c
+++ b/testcases/kernel/syscalls/vmsplice/vmsplice01.c
@@ -101,7 +101,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/wait/wait02.c b/testcases/kernel/syscalls/wait/wait02.c
index bb4c9fc..aa21967 100644
--- a/testcases/kernel/syscalls/wait/wait02.c
+++ b/testcases/kernel/syscalls/wait/wait02.c
@@ -139,7 +139,11 @@
* parse standard options
***************************************************************/
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
/***************************************************************
* perform global setup for test
diff --git a/testcases/kernel/syscalls/wait4/wait401.c b/testcases/kernel/syscalls/wait4/wait401.c
index 74f4d53..0ff8976 100644
--- a/testcases/kernel/syscalls/wait4/wait401.c
+++ b/testcases/kernel/syscalls/wait4/wait401.c
@@ -81,7 +81,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -155,7 +159,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
diff --git a/testcases/kernel/syscalls/wait4/wait402.c b/testcases/kernel/syscalls/wait4/wait402.c
index 83afb6a..e226f66 100644
--- a/testcases/kernel/syscalls/wait4/wait402.c
+++ b/testcases/kernel/syscalls/wait4/wait402.c
@@ -102,7 +102,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
}
setup(); /* global setup */
@@ -173,7 +177,7 @@
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
diff --git a/testcases/kernel/syscalls/waitid/waitid01.c b/testcases/kernel/syscalls/waitid/waitid01.c
index e2c6801..b1bc831 100644
--- a/testcases/kernel/syscalls/waitid/waitid01.c
+++ b/testcases/kernel/syscalls/waitid/waitid01.c
@@ -131,7 +131,11 @@
/* parse standard options */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
tst_exit();
}
diff --git a/testcases/kernel/syscalls/waitid/waitid02.c b/testcases/kernel/syscalls/waitid/waitid02.c
index 862273f..1d610c2 100644
--- a/testcases/kernel/syscalls/waitid/waitid02.c
+++ b/testcases/kernel/syscalls/waitid/waitid02.c
@@ -124,7 +124,11 @@
/* parse standard options */
msg = parse_opts(ac, av, NULL, NULL);
if (msg != NULL) {
+<<<<<<< HEAD
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+=======
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+>>>>>>> master
tst_exit();
}
diff --git a/testcases/kernel/syscalls/waitpid/waitpid01.c b/testcases/kernel/syscalls/waitpid/waitpid01.c
index 7ffad37..323bc63 100644
--- a/testcases/kernel/syscalls/waitpid/waitpid01.c
+++ b/testcases/kernel/syscalls/waitpid/waitpid01.c
@@ -72,7 +72,7 @@
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
setup();
@@ -135,7 +135,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
@@ -169,4 +169,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/waitpid/waitpid02.c b/testcases/kernel/syscalls/waitpid/waitpid02.c
index bb3b4da..038a42d 100644
--- a/testcases/kernel/syscalls/waitpid/waitpid02.c
+++ b/testcases/kernel/syscalls/waitpid/waitpid02.c
@@ -153,7 +153,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
@@ -197,4 +197,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/waitpid/waitpid03.c b/testcases/kernel/syscalls/waitpid/waitpid03.c
index 074b7cb..15dd98f 100644
--- a/testcases/kernel/syscalls/waitpid/waitpid03.c
+++ b/testcases/kernel/syscalls/waitpid/waitpid03.c
@@ -85,7 +85,7 @@
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
#ifdef UCLINUX
maybe_run_child(&do_child, "d", &ikids_uclinux);
#endif
@@ -162,7 +162,7 @@
condition_number++;
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
@@ -215,4 +215,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/waitpid/waitpid04.c b/testcases/kernel/syscalls/waitpid/waitpid04.c
index 8d1c30b..f9e4f61 100644
--- a/testcases/kernel/syscalls/waitpid/waitpid04.c
+++ b/testcases/kernel/syscalls/waitpid/waitpid04.c
@@ -73,7 +73,7 @@
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
setup();
@@ -143,7 +143,7 @@
condition_number++;
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
@@ -177,4 +177,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/waitpid/waitpid05.c b/testcases/kernel/syscalls/waitpid/waitpid05.c
index 7001236..588bc4e 100644
--- a/testcases/kernel/syscalls/waitpid/waitpid05.c
+++ b/testcases/kernel/syscalls/waitpid/waitpid05.c
@@ -86,7 +86,7 @@
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
#ifdef UCLINUX
maybe_run_child(&do_child_uclinux, "d", &sig_uclinux);
#endif
@@ -209,7 +209,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
@@ -279,4 +279,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/waitpid/waitpid06.c b/testcases/kernel/syscalls/waitpid/waitpid06.c
index 21a1b2f..2356455 100644
--- a/testcases/kernel/syscalls/waitpid/waitpid06.c
+++ b/testcases/kernel/syscalls/waitpid/waitpid06.c
@@ -87,7 +87,7 @@
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
#ifdef UCLINUX
argv0 = argv[0];
@@ -134,7 +134,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
@@ -180,7 +180,7 @@
#else
do_exit();
#endif
- /*NOTREACHED*/} else if (ret_val < 0) {
+ } else if (ret_val < 0) {
tst_resm(TFAIL, "Fork kid %d failed. "
"errno = %d", kid_count, errno);
exit(ret_val);
@@ -315,7 +315,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
void inthandlr()
{
diff --git a/testcases/kernel/syscalls/waitpid/waitpid07.c b/testcases/kernel/syscalls/waitpid/waitpid07.c
index f5b2e19..68fba38 100644
--- a/testcases/kernel/syscalls/waitpid/waitpid07.c
+++ b/testcases/kernel/syscalls/waitpid/waitpid07.c
@@ -88,7 +88,7 @@
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
#ifdef UCLINUX
argv0 = argv[0];
@@ -136,7 +136,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
@@ -184,7 +184,7 @@
#else
do_exit();
#endif
- /*NOTREACHED*/}
+ }
if (ret_val < 0) {
tst_resm(TFAIL, "Fork kid %d failed. "
@@ -327,7 +327,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
void inthandlr()
{
diff --git a/testcases/kernel/syscalls/waitpid/waitpid08.c b/testcases/kernel/syscalls/waitpid/waitpid08.c
index d4ca1d9..06837e2 100644
--- a/testcases/kernel/syscalls/waitpid/waitpid08.c
+++ b/testcases/kernel/syscalls/waitpid/waitpid08.c
@@ -87,7 +87,7 @@
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
#ifdef UCLINUX
argv0 = argv[0];
@@ -219,7 +219,7 @@
tst_resm(TFAIL, "Kill of child %d "
"failed, errno = %d", i, errno);
tst_exit();
- /*NOTREACHED*/}
+ }
}
/*
@@ -352,7 +352,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
void inthandlr()
{
diff --git a/testcases/kernel/syscalls/waitpid/waitpid09.c b/testcases/kernel/syscalls/waitpid/waitpid09.c
index f9ebf44..09a88f5 100644
--- a/testcases/kernel/syscalls/waitpid/waitpid09.c
+++ b/testcases/kernel/syscalls/waitpid/waitpid09.c
@@ -94,7 +94,7 @@
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
#ifdef UCLINUX
maybe_run_child(&do_exit_uclinux, "");
#endif
@@ -103,7 +103,7 @@
if ((pid = FORK_OR_VFORK()) < 0) {
tst_brkm(TFAIL, cleanup, "Fork Failed");
- /*NOTREACHED*/} else if (pid == 0) {
+ } else if (pid == 0) {
/*
* Child:
* Set up to catch SIGINT. The kids will wait till a
@@ -121,12 +121,12 @@
fail = 0;
if ((pid = FORK_OR_VFORK()) < 0) {
tst_brkm(TFAIL, cleanup, "Fork failed.");
- /*NOTREACHED*/} else if (pid == 0) { /* child */
+ } else if (pid == 0) { /* child */
#ifdef UCLINUX
if (self_exec(argv[0], "") < 0) {
tst_brkm(TFAIL, cleanup,
"self_exec failed");
- /*NOTREACHED*/}
+ }
#else
do_exit();
#endif
@@ -183,7 +183,7 @@
if ((pid = FORK_OR_VFORK()) < 0) {
tst_brkm(TFAIL, cleanup, "Second fork failed.");
- /*NOTREACHED*/} else if (pid == 0) { /* child */
+ } else if (pid == 0) { /* child */
exit(0);
} else { /* parent */
/* Give the child time to startup and exit */
@@ -251,13 +251,13 @@
}
cleanup();
- /*NOTREACHED*/} else { /* parent */
+ } else { /* parent */
/* wait for the child to return */
waitpid(pid, &status, 0);
if (WEXITSTATUS(status) != 0) {
tst_brkm(TBROK, cleanup, "child returned bad "
"status");
- /*NOTREACHED*/}
+ }
}
return 0;
@@ -274,7 +274,7 @@
tst_brkm(TFAIL, cleanup, "signal SIGINT failed, errno = %d",
errno);
tst_exit();
- /*NOTREACHED*/}
+ }
}
/*
@@ -307,7 +307,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
void inthandlr()
{
diff --git a/testcases/kernel/syscalls/waitpid/waitpid10.c b/testcases/kernel/syscalls/waitpid/waitpid10.c
index 854df68..b90601d 100644
--- a/testcases/kernel/syscalls/waitpid/waitpid10.c
+++ b/testcases/kernel/syscalls/waitpid/waitpid10.c
@@ -424,7 +424,7 @@
}
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
@@ -458,7 +458,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
void alrmhandlr()
{
diff --git a/testcases/kernel/syscalls/waitpid/waitpid11.c b/testcases/kernel/syscalls/waitpid/waitpid11.c
index 3ffc4be..9b96fdc 100644
--- a/testcases/kernel/syscalls/waitpid/waitpid11.c
+++ b/testcases/kernel/syscalls/waitpid/waitpid11.c
@@ -82,7 +82,7 @@
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
#ifdef UCLINUX
maybe_run_child(&do_exit_uclinux, "");
#endif
@@ -113,9 +113,9 @@
tst_resm(TPASS, "%s PASSED", TCID);
}
cleanup();
- /*NOTREACHED*/} else if (pid < 0) {
+ } else if (pid < 0) {
tst_brkm(TBROK, cleanup, "fork failed");
- /*NOTREACHED*/}
+ }
/*
* Set up to catch SIGINT. The kids will wait till a SIGINT
@@ -138,17 +138,17 @@
tst_resm(TFAIL, "self_exec kid %d "
"failed", kid_count);
tst_exit();
- /*NOTREACHED*/}
+ }
#else
do_exit();
#endif
- /*NOTREACHED*/}
+ }
if (ret_val < 0) {
tst_resm(TFAIL, "Fork kid %d failed. errno = "
"%d", kid_count, errno);
tst_exit();
- /*NOTREACHED*/}
+ }
/* parent */
fork_kid_pid[kid_count] = ret_val;
@@ -167,7 +167,7 @@
tst_resm(TFAIL, "Kill of child %d failed, "
"errno = %d", i, errno);
tst_exit();
- /*NOTREACHED*/}
+ }
}
/*
@@ -316,7 +316,7 @@
if ((sig_t) signal(SIGINT, inthandlr) == SIG_ERR) {
tst_resm(TFAIL, "signal SIGINT failed, errno = %d", errno);
tst_exit();
- /*NOTREACHED*/}
+ }
}
/*
@@ -346,7 +346,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
void inthandlr()
{
diff --git a/testcases/kernel/syscalls/waitpid/waitpid12.c b/testcases/kernel/syscalls/waitpid/waitpid12.c
index 6567ffe..542eb7e 100644
--- a/testcases/kernel/syscalls/waitpid/waitpid12.c
+++ b/testcases/kernel/syscalls/waitpid/waitpid12.c
@@ -84,7 +84,7 @@
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
#ifdef UCLINUX
maybe_run_child(&do_exit_uclinux, "");
#endif
@@ -114,9 +114,9 @@
tst_resm(TPASS, "%s PASSED", TCID);
}
cleanup();
- /*NOTREACHED*/} else if (pid < 0) {
+ } else if (pid < 0) {
tst_brkm(TBROK, cleanup, "fork failed");
- /*NOTREACHED*/}
+ }
/*
* Set up to catch SIGINT. The kids will wait till a SIGINT
@@ -139,17 +139,17 @@
tst_resm(TFAIL, "self_exec kid %d "
"failed", kid_count);
tst_exit();
- /*NOTREACHED*/}
+ }
#else
do_exit();
#endif
- /*NOTREACHED*/}
+ }
if (ret_val < 0) {
tst_resm(TFAIL, "Fork kid %d failed. errno = "
"%d", kid_count, errno);
tst_exit();
- /*NOTREACHED*/}
+ }
/* parent */
fork_kid_pid[kid_count] = ret_val;
@@ -174,7 +174,7 @@
tst_resm(TFAIL, "Kill of child %d failed, "
"errno = %d", i, errno);
tst_exit();
- /*NOTREACHED*/}
+ }
}
/*
@@ -324,7 +324,7 @@
if ((sig_t) signal(SIGINT, inthandlr) == SIG_ERR) {
tst_resm(TFAIL, "signal SIGINT failed, errno = %d", errno);
tst_exit();
- /*NOTREACHED*/}
+ }
}
/*
@@ -357,7 +357,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
void inthandlr()
{
diff --git a/testcases/kernel/syscalls/waitpid/waitpid13.c b/testcases/kernel/syscalls/waitpid/waitpid13.c
index 5b6f93b..37f5dc5 100644
--- a/testcases/kernel/syscalls/waitpid/waitpid13.c
+++ b/testcases/kernel/syscalls/waitpid/waitpid13.c
@@ -111,9 +111,9 @@
tst_resm(TPASS, "%s PASSED", TCID);
}
cleanup();
- /*NOTREACHED*/} else if (pid < 0) {
+ } else if (pid < 0) {
tst_brkm(TBROK, cleanup, "fork failed");
- /*NOTREACHED*/}
+ }
/*
* Set up to catch SIGINT. The kids will wait till a SIGINT
@@ -136,17 +136,17 @@
tst_resm(TFAIL, "self_exec kid %d "
"failed", kid_count);
tst_exit();
- /*NOTREACHED*/}
+ }
#else
do_exit();
#endif
- /*NOTREACHED*/}
+ }
if (ret_val < 0) {
tst_resm(TFAIL, "Fork kid %d failed. errno = "
"%d", kid_count, errno);
tst_exit();
- /*NOTREACHED*/}
+ }
/* parent */
fork_kid_pid[kid_count] = ret_val;
@@ -377,7 +377,7 @@
if ((sig_t) signal(SIGINT, inthandlr) == SIG_ERR) {
tst_brkm(TFAIL, cleanup, "signal SIGINT failed, errno = %d",
errno);
- /*NOTREACHED*/}
+ }
}
/*
@@ -407,7 +407,7 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
void inthandlr()
{
diff --git a/testcases/kernel/syscalls/write/write02.c b/testcases/kernel/syscalls/write/write02.c
index 2518eed..8eea5b7 100644
--- a/testcases/kernel/syscalls/write/write02.c
+++ b/testcases/kernel/syscalls/write/write02.c
@@ -77,7 +77,7 @@
/* parse standard options */
if ((msg = parse_opts(argc, argv, NULL, NULL))) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+ }
setup(); /* global setup for test */
@@ -98,7 +98,7 @@
if ((fild = creat(pfiln, 0777)) == -1) {
tst_brkm(TBROK, cleanup, "Can't creat Xwrit");
- /*NOTREACHED*/}
+ }
for (iws = BUFSIZ; iws > 0; iws--) {
if ((cwrite = write(fild, pwbuf, iws)) != iws) {
TEST_ERROR_LOG(errno);
@@ -115,7 +115,7 @@
close(fild);
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
diff --git a/testcases/kernel/syscalls/write/write03.c b/testcases/kernel/syscalls/write/write03.c
index 42c7c8a..37d06db 100644
--- a/testcases/kernel/syscalls/write/write03.c
+++ b/testcases/kernel/syscalls/write/write03.c
@@ -83,7 +83,7 @@
if ((msg = parse_opts(argc, argv, NULL, NULL)) !=
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+ }
/* global setup */
setup();
@@ -102,31 +102,31 @@
if (fd < 0) {
tst_resm(TBROK, "creating a new file failed");
cleanup();
- /*NOTREACHED*/}
+ }
(void)memset(wbuf, '0', 100);
if (write(fd, wbuf, 100) == -1) {
tst_resm(TFAIL, "failed to write to %s", filename);
cleanup();
- /*NOTREACHED*/}
+ }
if (write(fd, bad_addr, 100) != -1) {
tst_resm(TFAIL, "write(2) failed to fail");
cleanup();
- /*NOTREACHED*/}
+ }
TEST_ERROR_LOG(errno);
close(fd);
if ((fd = open(filename, O_RDONLY)) == -1) {
tst_resm(TBROK, "open(2) failed, errno: %d", errno);
cleanup();
- /*NOTREACHED*/}
+ }
if (read(fd, rbuf, 100) == -1) {
tst_resm(TBROK, "read(2) failed, errno: %d", errno);
cleanup();
- /*NOTREACHED*/}
+ }
if (memcmp(wbuf, rbuf, 100) == 0) {
tst_resm(TPASS, "failure of write(2) didnot corrupt "
@@ -139,7 +139,7 @@
close(fd);
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
#else
@@ -200,4 +200,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/write/write04.c b/testcases/kernel/syscalls/write/write04.c
index b063901..9e4ab2e 100644
--- a/testcases/kernel/syscalls/write/write04.c
+++ b/testcases/kernel/syscalls/write/write04.c
@@ -86,7 +86,7 @@
if ((msg = parse_opts(argc, argv, NULL, NULL)) !=
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+ }
/* global setup */
setup();
@@ -101,15 +101,15 @@
if (mknod(fifo, S_IFIFO | 0777, 0) < 0) {
tst_resm(TBROK, "mknod() failed, errno: %d", errno);
cleanup();
- /*NOTREACHED*/}
+ }
if (stat(fifo, &buf) != 0) {
tst_resm(TBROK, "stat() failed, errno: %d", errno);
cleanup();
- /*NOTREACHED*/}
+ }
if ((buf.st_mode & S_IFIFO) == 0) {
tst_resm(TBROK, "Mode does not indicate fifo file");
cleanup();
- /*NOTREACHED*/}
+ }
#if 0
sigset(SIGALRM, alarm_handler);
#endif
@@ -148,7 +148,7 @@
if (sigsetjmp(jmp, 1)) {
tst_resm(TBROK, "setjmp() failed");
cleanup();
- /*NOTREACHED*/}
+ }
(void)alarm(10); /* set alarm for 10 seconds */
wfd = open(fifo, O_WRONLY | O_NONBLOCK);
(void)alarm(0);
@@ -207,7 +207,7 @@
unlink(fifo);
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
void alarm_handler()
@@ -256,4 +256,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/write/write05.c b/testcases/kernel/syscalls/write/write05.c
index 8345790..ece3fbd 100644
--- a/testcases/kernel/syscalls/write/write05.c
+++ b/testcases/kernel/syscalls/write/write05.c
@@ -89,7 +89,7 @@
if ((msg = parse_opts(argc, argv, NULL, NULL)) !=
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+ }
/* global setup */
setup();
@@ -119,19 +119,19 @@
if (fd < 0) {
tst_resm(TFAIL, "creating a new file failed");
cleanup();
- /*NOTREACHED*/}
+ }
if (write(fd, bad_addr, 10) != -1) {
tst_resm(TFAIL, "write() on an invalid buffer "
"succeeded, but should have failed");
cleanup();
- /*NOTREACHED*/} else {
+ } else {
TEST_ERROR_LOG(errno);
if (errno != EFAULT) {
tst_resm(TFAIL, "write() returned illegal "
"errno: expected EFAULT, got %d",
errno);
cleanup();
- /*NOTREACHED*/}
+ }
tst_resm(TPASS, "received EFAULT as expected.");
}
tst_resm(TINFO, "Exit Block 2");
@@ -180,7 +180,7 @@
close(fd);
}
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
@@ -236,4 +236,4 @@
/* exit with return code appropriate for results */
tst_exit();
- /*NOTREACHED*/}
+ }
diff --git a/testcases/kernel/syscalls/writev/writev01.c b/testcases/kernel/syscalls/writev/writev01.c
index 55406fd..d934052 100644
--- a/testcases/kernel/syscalls/writev/writev01.c
+++ b/testcases/kernel/syscalls/writev/writev01.c
@@ -141,7 +141,7 @@
if ((msg = parse_opts(argc, argv, NULL, NULL)) !=
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+ }
/* set "tstdir", and "testfile" vars */
setup();
@@ -162,12 +162,12 @@
if (signal(SIGTERM, sighandler) == SIG_ERR) {
perror("signal: SIGTERM");
cleanup();
- /*NOTREACHED*/}
+ }
if (signal(SIGPIPE, sighandler) == SIG_ERR) {
perror("signal: SIGPIPE");
cleanup();
- /*NOTREACHED*/}
+ }
init_buffs(buf_list);
@@ -175,24 +175,24 @@
tst_resm(TFAIL, "open failed: fname = %s, errno = %d",
f_name, errno);
cleanup();
- /*NOTREACHED*/} else
+ } else
if ((nbytes = write(fd[0], buf_list[2], K_1)) != K_1) {
tst_resm(TFAIL,
"write failed: nbytes = %d, " "errno = %d",
nbytes, errno);
cleanup();
- /*NOTREACHED*/}
+ }
if (close(fd[0]) < 0) {
tst_resm(TFAIL, "close failed: errno: %d", errno);
cleanup();
- /*NOTREACHED*/}
+ }
if ((fd[0] = open(f_name, O_RDWR, 0666)) < 0) {
tst_resm(TFAIL, "open failed: fname = %s, errno = %d",
f_name, errno);
cleanup();
- /*NOTREACHED*/}
+ }
//block1: /* given vector length -1, writev() return EINVAL. */
tst_resm(TINFO, "Enter Block 1");
fail = 0;
@@ -443,7 +443,7 @@
close(fd[0]);
close(fd[1]);
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
/*
@@ -521,7 +521,7 @@
default:
tst_resm(TFAIL, "Error detected: init_buffs()");
cleanup();
- /*NOTREACHED*/}
+ }
}
return 0;
}
@@ -560,7 +560,7 @@
tst_resm(TFAIL, "unlink Failed--file = %s, errno = %d",
f_name, errno);
tst_exit();
- /*NOTREACHED*/}
+ }
exit(sig);
}
diff --git a/testcases/kernel/syscalls/writev/writev02.c b/testcases/kernel/syscalls/writev/writev02.c
index d361efe..3bd247e 100644
--- a/testcases/kernel/syscalls/writev/writev02.c
+++ b/testcases/kernel/syscalls/writev/writev02.c
@@ -108,7 +108,7 @@
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
setup(); /* set "tstdir", and "testfile" vars */
@@ -131,37 +131,37 @@
perror("signal");
tst_resm(TFAIL, "signal() SIGTERM FAILED");
cleanup();
- /*NOTREACHED*/}
+ }
if (signal(SIGPIPE, sighandler) == SIG_ERR) {
perror("signal");
tst_resm(TFAIL, "signal() SIGPIPE FAILED");
cleanup();
- /*NOTREACHED*/}
+ }
if ((fd[0] = open(f_name, O_WRONLY | O_CREAT, 0666)) < 0) {
tst_resm(TFAIL, "open(2) failed: fname = %s, "
"errno = %d", f_name, errno);
cleanup();
- /*NOTREACHED*/} else {
+ } else {
l_seek(fd[0], K_1, 0);
if ((nbytes = write(fd[0], buf_list[1], K_1)) != K_1) {
tst_resm(TFAIL, "write(2) failed: nbytes "
"= %d, errno = %d", nbytes, errno);
cleanup();
- /*NOTREACHED*/}
+ }
}
if (close(fd[0]) < 0) {
tst_resm(TFAIL, "close failed: errno = %d", errno);
cleanup();
- /*NOTREACHED*/}
+ }
if ((fd[0] = open(f_name, O_RDWR, 0666)) < 0) {
tst_resm(TFAIL, "open failed: fname = %s, errno = %d",
f_name, errno);
cleanup();
- /*NOTREACHED*/}
+ }
//block1:
/*
* In this block we are trying to call writev() with invalid
@@ -303,7 +303,7 @@
tst_resm(TFAIL, "unlink Failed--file = %s, errno = %d",
f_name, errno);
cleanup();
- /*NOTREACHED*/}
+ }
exit(sig);
}
diff --git a/testcases/kernel/syscalls/writev/writev03.c b/testcases/kernel/syscalls/writev/writev03.c
index dd0ef3a..135d650 100644
--- a/testcases/kernel/syscalls/writev/writev03.c
+++ b/testcases/kernel/syscalls/writev/writev03.c
@@ -104,7 +104,7 @@
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
/* set "tstdir", and "testfile" vars */
setup();
@@ -126,13 +126,13 @@
perror("signal");
tst_resm(TFAIL, "signal() SIGTERM FAILED");
cleanup();
- /*NOTREACHED*/}
+ }
if (signal(SIGPIPE, sighandler) == SIG_ERR) {
perror("signal");
tst_resm(TFAIL, "signal() SIGPIPE FAILED");
cleanup();
- /*NOTREACHED*/}
+ }
memset(buf_list[0], 0, K_1);
memset(buf_list[1], 0, K_1);
@@ -141,24 +141,24 @@
tst_resm(TFAIL, "open(2) failed: fname = %s, "
"errno = %d", f_name, errno);
cleanup();
- /*NOTREACHED*/} else {
+ } else {
if ((nbytes = write(fd[0], buf_list[1], K_1)) != K_1) {
tst_resm(TFAIL, "write(2) failed: nbytes "
"= %d, errno = %d", nbytes, errno);
cleanup();
- /*NOTREACHED*/}
+ }
}
if (close(fd[0]) < 0) {
tst_resm(TFAIL, "close failed: errno = %d", errno);
cleanup();
- /*NOTREACHED*/}
+ }
if ((fd[0] = open(f_name, O_RDWR, 0666)) < 0) {
tst_resm(TFAIL, "open failed: fname = %s, errno = %d",
f_name, errno);
cleanup();
- /*NOTREACHED*/}
+ }
//block1:
tst_resm(TINFO, "Enter block 1");
fail = 0;
@@ -352,7 +352,7 @@
tst_resm(TFAIL, "unlink Failed--file = %s, errno = %d",
f_name, errno);
cleanup();
- /*NOTREACHED*/}
+ }
exit(sig);
}
diff --git a/testcases/kernel/syscalls/writev/writev04.c b/testcases/kernel/syscalls/writev/writev04.c
index 634269a..2ca07af 100644
--- a/testcases/kernel/syscalls/writev/writev04.c
+++ b/testcases/kernel/syscalls/writev/writev04.c
@@ -104,7 +104,7 @@
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
tst_exit();
- /*NOTREACHED*/}
+ }
setup(); /* set "tstdir", and "testfile" vars */
@@ -125,13 +125,13 @@
perror("signal");
tst_resm(TFAIL, "signal() SIGTERM FAILED");
cleanup();
- /*NOTREACHED*/}
+ }
if (signal(SIGPIPE, sighandler) == SIG_ERR) {
perror("signal");
tst_resm(TFAIL, "signal() SIGPIPE FAILED");
cleanup();
- /*NOTREACHED*/}
+ }
memset(buf_list[0], 0, K_1);
memset(buf_list[1], 0, K_1);
@@ -140,24 +140,24 @@
tst_resm(TFAIL, "open(2) failed: fname = %s, "
"errno = %d", f_name, errno);
cleanup();
- /*NOTREACHED*/} else {
+ } else {
if ((nbytes = write(fd[0], buf_list[1], K_1)) != K_1) {
tst_resm(TFAIL, "write(2) failed: nbytes "
"= %d, errno = %d", nbytes, errno);
cleanup();
- /*NOTREACHED*/}
+ }
}
if (close(fd[0]) < 0) {
tst_resm(TFAIL, "close failed: errno = %d", errno);
cleanup();
- /*NOTREACHED*/}
+ }
if ((fd[0] = open(f_name, O_RDWR, 0666)) < 0) {
tst_resm(TFAIL, "open failed: fname = %s, errno = %d",
f_name, errno);
cleanup();
- /*NOTREACHED*/ return 0;
+ return 0;
}
//block1:
tst_resm(TINFO, "Enter block 1");
@@ -361,7 +361,7 @@
tst_resm(TFAIL, "unlink Failed--file = %s, errno = %d",
f_name, errno);
cleanup();
- /*NOTREACHED*/}
+ }
exit(sig);
}
diff --git a/testcases/kernel/syscalls/writev/writev05.c b/testcases/kernel/syscalls/writev/writev05.c
index 476a80a..c4908e7 100644
--- a/testcases/kernel/syscalls/writev/writev05.c
+++ b/testcases/kernel/syscalls/writev/writev05.c
@@ -102,7 +102,7 @@
if ((msg = parse_opts(argc, argv, NULL, NULL)) !=
NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /*NOTREACHED*/}
+ }
setup(); /* set "tstdir", and "testfile" vars */
@@ -121,13 +121,13 @@
perror("signal");
tst_resm(TFAIL, "signal() SIGTERM FAILED");
cleanup();
- /*NOTREACHED*/}
+ }
if (signal(SIGPIPE, sighandler) == SIG_ERR) {
perror("signal");
tst_resm(TFAIL, "signal() SIGPIPE FAILED");
cleanup();
- /*NOTREACHED*/}
+ }
/* Fill the buf_list[0] and buf_list[1] with 0 zeros */
memset(buf_list[0], 0, K_1);
@@ -137,24 +137,24 @@
tst_resm(TFAIL, "open(2) failed: fname = %s, "
"errno = %d", f_name, errno);
cleanup();
- /*NOTREACHED*/} else {
+ } else {
if ((nbytes = write(fd[0], buf_list[1], K_1)) != K_1) {
tst_resm(TFAIL, "write(2) failed: nbytes "
"= %d, errno = %d", nbytes, errno);
cleanup();
- /*NOTREACHED*/}
+ }
}
if (close(fd[0]) < 0) {
tst_resm(TFAIL, "close failed: errno = %d", errno);
cleanup();
- /*NOTREACHED*/}
+ }
if ((fd[0] = open(f_name, O_RDWR, 0666)) < 0) {
tst_resm(TFAIL, "open failed: fname = %s, errno = %d",
f_name, errno);
cleanup();
- /*NOTREACHED*/}
+ }
/*
* In this block we are trying to call writev() with invalid
@@ -290,7 +290,7 @@
tst_resm(TFAIL, "unlink Failed--file = %s, errno = %d",
f_name, errno);
cleanup();
- /*NOTREACHED*/}
+ }
exit(sig);
}
diff --git a/testcases/kernel/syscalls/writev/writev06.c b/testcases/kernel/syscalls/writev/writev06.c
index d40e711..2165c3d 100644
--- a/testcases/kernel/syscalls/writev/writev06.c
+++ b/testcases/kernel/syscalls/writev/writev06.c
@@ -88,7 +88,7 @@
/* parse standard options */
if ((msg = parse_opts(argc, argv, NULL, NULL)) != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- /* NOTREACHED */
+
}
setup(); /* set "tstdir", and "testfile" vars */
@@ -105,21 +105,21 @@
perror("signal");
tst_resm(TFAIL, "signal() SIGTERM FAILED");
cleanup();
- /* NOTREACHED */
+
}
if (signal(SIGPIPE, sighandler) == SIG_ERR) {
perror("signal");
tst_resm(TFAIL, "signal() SIGPIPE FAILED");
cleanup();
- /* NOTREACHED */
+
}
if ((fd[0] = open(f_name, O_WRONLY | O_CREAT, 0666)) < 0) {
tst_resm(TFAIL, "open(2) failed: fname = %s, "
"errno = %d", f_name, errno);
cleanup();
- /* NOTREACHED */
+
}
/*
@@ -261,7 +261,7 @@
tst_resm(TFAIL, "unlink Failed--file = %s, errno = %d",
f_name, errno);
cleanup();
- /* NOTREACHED */
+
}
exit(sig);
}