Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/util-linux/flock.c
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/util-linux/flock.c
r2725 r3232 4 4 * This is free software, licensed under the GNU General Public License v2. 5 5 */ 6 7 //usage:#define flock_trivial_usage 8 //usage: "[-sxun] FD|{FILE [-c] PROG ARGS}" 9 //usage:#define flock_full_usage "\n\n" 10 //usage: "[Un]lock file descriptor, or lock FILE, run PROG\n" 11 //usage: "\n -s Shared lock" 12 //usage: "\n -x Exclusive lock (default)" 13 //usage: "\n -u Unlock FD" 14 //usage: "\n -n Fail rather than wait" 15 6 16 #include <sys/file.h> 7 17 #include "libbb.h" … … 20 30 21 31 #if ENABLE_LONG_OPTS 22 32 static const char getopt_longopts[] ALIGN1 = 23 33 "shared\0" No_argument "s" 24 34 "exclusive\0" No_argument "x" … … 36 46 fd = open(argv[0], O_RDONLY|O_NOCTTY|O_CREAT, 0666); 37 47 if (fd < 0 && errno == EISDIR) 38 48 fd = open(argv[0], O_RDONLY|O_NOCTTY); 39 49 if (fd < 0) 40 50 bb_perror_msg_and_die("can't open '%s'", argv[0]);
Note:
See TracChangeset
for help on using the changeset viewer.