From ec99d14ad615ab69e1aa068103571273af4c226e Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 3 Jul 2024 17:22:50 +0300 Subject: [PATCH] fixed --- README.md | 6 +++--- src/coreutils/bdname/bdname.c | 2 +- src/coreutils/chroot/chroot.c | 10 +++++++--- src/coreutils/dd/dd.c | 28 ++++++++++++++++++++++++---- src/coreutils/du/du.c | 2 +- src/coreutils/head/head.c | 4 +++- src/coreutils/id/id.c | 2 +- src/coreutils/ln/ln.c | 2 +- src/coreutils/ls/ls.c | 2 +- src/coreutils/mkdir/mkdir.c | 2 +- src/coreutils/mknod/mknod.c | 4 ++-- src/coreutils/mktemp/mktemp.c | 2 +- src/coreutils/mv/mv.c | 2 +- src/coreutils/nice/nice.c | 2 +- src/coreutils/nohup/nohup.c | 2 +- src/coreutils/printenv/printenv.c | 2 +- src/coreutils/readlink/readlink.c | 2 +- src/coreutils/renice/renice.c | 2 +- src/coreutils/rm/rm.c | 2 +- src/coreutils/setsid/setsid.c | 2 +- src/coreutils/shred/shred.c | 2 +- src/coreutils/sleep/sleep.c | 2 +- src/coreutils/split/split.c | 2 +- src/coreutils/tee/tee.c | 2 +- src/coreutils/time/time.c | 2 +- src/coreutils/touch/touch.c | 2 +- src/coreutils/uname/uname.c | 2 +- src/coreutils/wc/wc.c | 2 +- src/findutils/xargs/xargs.c | 2 +- src/loginutils/cryptpw/cryptpw.c | 2 +- src/loginutils/su/su.c | 2 +- src/sysutils-linux/dmesg/dmesg.c | 2 +- src/sysutils-linux/mount/mount.c | 2 +- src/sysutils-linux/umount/umount.c | 2 +- 34 files changed, 68 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 38b5698..460ce67 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # micro-utils -Own implementation of *nix utils -License: wtfpl +Own implementation of *nix utils +License: wtfpl -Author: 8nl +https://trivial.technology/ diff --git a/src/coreutils/bdname/bdname.c b/src/coreutils/bdname/bdname.c index 9ccbd5f..ac1dec0 100644 --- a/src/coreutils/bdname/bdname.c +++ b/src/coreutils/bdname/bdname.c @@ -19,7 +19,7 @@ char *bname(char *str, const char *suffix) { int main(int argc, char **argv) { char *suffix = NULL; char d_flag = 0; - + int opt; while ((opt = getopt(argc, argv, "s:d")) != -1) { switch (opt) { diff --git a/src/coreutils/chroot/chroot.c b/src/coreutils/chroot/chroot.c index 585904a..a5782a9 100644 --- a/src/coreutils/chroot/chroot.c +++ b/src/coreutils/chroot/chroot.c @@ -4,12 +4,16 @@ #include #include -int main(const int argc, char **argv) { - if (argc < 3 || !strcmp(argv[argc - 1], "--help")) { +int main(int argc, char **argv) { + int opt; + while ((opt = getopt(argc, argv, "")) != -1 || argc == 1) { puts("chroot [dir] [command] [arg arg2...]"); return 0; } + argv += optind; + argc -= optind; + if (chroot(argv[1]) < 0) { fprintf(stderr, "chroot: %s\n", strerror(errno)); return 1; @@ -20,7 +24,7 @@ int main(const int argc, char **argv) { return 1; } - if (execvp(argv[2], argv + 2) < 0) { + if (execvp(argv[0], argv) < 0) { fprintf(stderr, "chroot: %s\n", strerror(errno)); return 1; } diff --git a/src/coreutils/dd/dd.c b/src/coreutils/dd/dd.c index fbc483a..3cca523 100644 --- a/src/coreutils/dd/dd.c +++ b/src/coreutils/dd/dd.c @@ -101,14 +101,18 @@ int main(int argc, char **argv) { int ofd = STDOUT_FILENO; int ifd = STDIN_FILENO; + char notrunc = 0; + char fsync_flag = 0; + /* Return value */ int ret = 1; + for (int i = 1; i < argc; i++) { char *arg = argv[i]; char *val = strchr(arg, '='); if (val == NULL) { - printf("dd\n\tif=InputFile\n\tof=OutputFile\n\tbs=ibs and obs\n\tibs=Input buffer size\n\tobs=Output buffer size\n\tseek=Skip N obs-sized output blocks\n\tskip=Skip N ibs-sized output blocks\n\tcount=Copy only N input blocks\n\nN and BYTES may be followed by the following multiplicative\nsuffixes: w=2, b=512, k=1000, K=1024, m=1000*1000,\nM=1024*1024, g=1000*1000*1000, G=1024*1024*1024\n"); + puts("dd\n\tif=InputFile\n\tof=OutputFile\n\tbs=ibs and obs\n\tibs=Input buffer size\n\tobs=Output buffer size\n\tseek=Skip N obs-sized output blocks\n\tskip=Skip N ibs-sized output blocks\n\tcount=Copy only N input blocks\n\tnconv=notrunc Don't truncate output file\n\tconv=fsync Physically write data out before finishing\n\nN and BYTES may be followed by the following multiplicative\nsuffixes: w=2, b=512, k=1000, K=1024, m=1000*1000,\nM=1024*1024, g=1000*1000*1000, G=1024*1024*1024"); return 1; } @@ -139,6 +143,15 @@ int main(int argc, char **argv) { else if (!strcmp(arg, "obs")) obs = strtonum(val); + + char *ptr = strstr(arg, "conv"); + if (ptr) { + if (strstr(val, "notrunc")) + notrunc = 1; + + if (strstr(val, "fsync")) + fsync_flag = 1; + } } if (bs) { @@ -172,12 +185,17 @@ int main(int argc, char **argv) { /* Output */ int oflag = O_WRONLY | O_CREAT; - if (seek) + if (seek && !notrunc) oflag |= O_TRUNC; ofd = openfile(1, ofp, oflag); if (seek) { - if (ftruncate(ofd, seek * ibs) < 0 || lseek(ofd, seek * ibs, SEEK_SET) < 0) { + if (!notrunc && ftruncate(ofd, seek * ibs) < 0) { + fprintf(stderr, "dd: %s\n", strerror(errno)); + goto CLOSE; + } + + if (lseek(ofd, seek * ibs, SEEK_SET) < 0) { fprintf(stderr, "dd: %s\n", strerror(errno)); goto CLOSE; } @@ -233,7 +251,9 @@ int main(int argc, char **argv) { } /* End */ - fsync(ofd); + if (fsync_flag) + fsync(ofd); + summary(); ret = 0; diff --git a/src/coreutils/du/du.c b/src/coreutils/du/du.c index b6c6fb8..d060fcc 100644 --- a/src/coreutils/du/du.c +++ b/src/coreutils/du/du.c @@ -88,7 +88,7 @@ int main(int argc, char **argv) { break; default: - printf("du [hsc] [src1 src2...]\n\t-h Sizes in human readable format\n\t-s Display only a total for each argument\n\t-c produce a grand total\n"); + puts("du [hsc] [src1 src2...]\n\t-h Sizes in human readable format\n\t-s Display only a total for each argument\n\t-c produce a grand total"); return 0; } } diff --git a/src/coreutils/head/head.c b/src/coreutils/head/head.c index 0327e95..a4082de 100644 --- a/src/coreutils/head/head.c +++ b/src/coreutils/head/head.c @@ -35,6 +35,7 @@ int print(const char *file, FILE *fp, long lines, long bytes) { long lmax = 0; long bmax = 0; + /* Make buffer */ size_t buf_size = 0; char *buf = malloc(1); if (buf == NULL) { @@ -65,6 +66,7 @@ int print(const char *file, FILE *fp, long lines, long bytes) { buf[buf_size] = '\0'; + /* Print buffer */ for (size_t i = 0; i < buf_size; i++) { if (buf[i] == '\n') lcount++; @@ -119,7 +121,7 @@ int main(int argc, char **argv) { break; default: - printf("head [ncv] [file1 file2...]\n\t-n Print [-]N lines\n\t-c Print [-]N bytes\n\t-v Print headers\n"); + puts("head [ncv] [file1 file2...]\n\t-n Print [-]N lines\n\t-c Print [-]N bytes\n\t-v Print headers"); return 0; } } diff --git a/src/coreutils/id/id.c b/src/coreutils/id/id.c index 5dcdc55..9e0a28c 100644 --- a/src/coreutils/id/id.c +++ b/src/coreutils/id/id.c @@ -68,7 +68,7 @@ int def_ids(uid_t uid, struct passwd *pwd) { } void usage(int sig) { - printf("id [gGurn] [user]\n\t-u User ID\n\t-g Group ID\n\t-G Supplementary group IDs\n\t-n Print names instead of numbers\n\t-r Print real ID instead of effective ID\n"); + puts("id [gGurn] [user]\n\t-u User ID\n\t-g Group ID\n\t-G Supplementary group IDs\n\t-n Print names instead of numbers\n\t-r Print real ID instead of effective ID"); exit(sig); } diff --git a/src/coreutils/ln/ln.c b/src/coreutils/ln/ln.c index 3ad6150..b6aafac 100644 --- a/src/coreutils/ln/ln.c +++ b/src/coreutils/ln/ln.c @@ -43,7 +43,7 @@ int main(int argc, char **argv) { break; default: - printf("ln [sfv] [src] [dst]\n\t-f Force\n\t-s Symbolic\n\t-v Verbose\n"); + puts("ln [sfv] [src] [dst]\n\t-f Force\n\t-s Symbolic\n\t-v Verbose"); return 0; } } diff --git a/src/coreutils/ls/ls.c b/src/coreutils/ls/ls.c index ed81348..93e6a2a 100644 --- a/src/coreutils/ls/ls.c +++ b/src/coreutils/ls/ls.c @@ -470,7 +470,7 @@ int main(int argc, char **argv) { break; default: - printf("ls [1alFcRdLhistS0] [dir1 file2...]\n\t-a Show hidden files\n\t-l Use a long listing format\n\t-F Append indicator to names\n\t-c Color mode\n\t-R Recursive\n\t-1 One column\n\t-d Print only dir names\n\t-L Follow symlinks\n\t-h Sizes in human readable format\n\t-i Listen inodes\n\t-t Sort by mtime\n\t-S Sort by size\n\t-s Print file size\n\t-0 End line with \\0\n"); + puts("ls [1alFcRdLhistS0] [dir1 file2...]\n\t-a Show hidden files\n\t-l Use a long listing format\n\t-F Append indicator to names\n\t-c Color mode\n\t-R Recursive\n\t-1 One column\n\t-d Print only dir names\n\t-L Follow symlinks\n\t-h Sizes in human readable format\n\t-i Listen inodes\n\t-t Sort by mtime\n\t-S Sort by size\n\t-s Print file size\n\t-0 End line with \\0"); return 0; } } diff --git a/src/coreutils/mkdir/mkdir.c b/src/coreutils/mkdir/mkdir.c index d3b1c1e..41edd10 100644 --- a/src/coreutils/mkdir/mkdir.c +++ b/src/coreutils/mkdir/mkdir.c @@ -61,7 +61,7 @@ int main(int argc, char **argv) { break; default: - printf("mkdir [pmv] [dst1 dst2...]\n\t-p Make parent dir\n\t-m MODE Mode\n\t-v Verbose\n"); + puts("mkdir [pmv] [dst1 dst2...]\n\t-p Make parent dir\n\t-m MODE Mode\n\t-v Verbose"); return 0; } } diff --git a/src/coreutils/mknod/mknod.c b/src/coreutils/mknod/mknod.c index 8b9f946..ad45941 100644 --- a/src/coreutils/mknod/mknod.c +++ b/src/coreutils/mknod/mknod.c @@ -38,8 +38,8 @@ int main(int argc, char **argv) { break; default: - printf("mknod [m] [NAME] [TYPE] [MAJOR MINOR]\n\t-m MODE\n\n"); - printf("Types:\n\tb - block device\n\tc or u - character device\n\tp - named pipe/fifo (MAJOR MINOR must be omitted)\n\ts - socket\n"); + puts("mknod [m] [NAME] [TYPE] [MAJOR MINOR]\n\t-m MODE\n"); + puts("Types:\n\tb - block device\n\tc or u - character device\n\tp - named pipe/fifo (MAJOR MINOR must be omitted)\n\ts - socket"); return 0; } } diff --git a/src/coreutils/mktemp/mktemp.c b/src/coreutils/mktemp/mktemp.c index b285da3..ab23f4b 100644 --- a/src/coreutils/mktemp/mktemp.c +++ b/src/coreutils/mktemp/mktemp.c @@ -60,7 +60,7 @@ int main(int argc, char **argv) { break; default: - printf("mktemp [dp] [file]\n\t-d Dir\n\t-p Base dir\n"); + puts("mktemp [dp] [file]\n\t-d Dir\n\t-p Base dir"); return 0; } } diff --git a/src/coreutils/mv/mv.c b/src/coreutils/mv/mv.c index 7cf88b0..a052890 100644 --- a/src/coreutils/mv/mv.c +++ b/src/coreutils/mv/mv.c @@ -38,7 +38,7 @@ int main(int argc, char **argv) { break; default: - printf("mv [f] [src1 src2...] [dst]\n\t-f Force\n"); + puts("mv [f] [src1 src2...] [dst]\n\t-f Force"); return 0; } } diff --git a/src/coreutils/nice/nice.c b/src/coreutils/nice/nice.c index fdb1988..e78acdb 100644 --- a/src/coreutils/nice/nice.c +++ b/src/coreutils/nice/nice.c @@ -17,7 +17,7 @@ int main(int argc, char **argv) { break; default: - printf("nice [n] [cmd] [arg1] [arg2]\n\t-n N Add N to the niceness\n"); + puts("nice [n] [cmd] [arg1] [arg2]\n\t-n N Add N to the niceness"); return 0; } } diff --git a/src/coreutils/nohup/nohup.c b/src/coreutils/nohup/nohup.c index ae5a54d..d806c1d 100644 --- a/src/coreutils/nohup/nohup.c +++ b/src/coreutils/nohup/nohup.c @@ -8,7 +8,7 @@ int main(int argc, char **argv) { if (argc < 2) { - printf("nohup: missing operand\nnohup [cmd]\n"); + puts("nohup: missing operand\nnohup [cmd]"); return 0; } diff --git a/src/coreutils/printenv/printenv.c b/src/coreutils/printenv/printenv.c index 79a595d..17a2f71 100644 --- a/src/coreutils/printenv/printenv.c +++ b/src/coreutils/printenv/printenv.c @@ -22,7 +22,7 @@ int printvars(int len, char **names) { int main(int argc, char **argv, const char **envp) { int opt; while ((opt = getopt(argc, argv, "0")) != -1) { - printf("printenv [var1 var2...]\n"); + puts("printenv [var1 var2...]"); return 0; } diff --git a/src/coreutils/readlink/readlink.c b/src/coreutils/readlink/readlink.c index 168bbb6..aa3ea88 100644 --- a/src/coreutils/readlink/readlink.c +++ b/src/coreutils/readlink/readlink.c @@ -16,7 +16,7 @@ int main(int argc, char **argv) { break; default: - printf("readlink [n] [file1 file2...]\n\t-n Don't add newline\n"); + puts("readlink [n] [file1 file2...]\n\t-n Don't add newline"); return 0; } } diff --git a/src/coreutils/renice/renice.c b/src/coreutils/renice/renice.c index 8cc8441..3cb704c 100644 --- a/src/coreutils/renice/renice.c +++ b/src/coreutils/renice/renice.c @@ -41,7 +41,7 @@ int main(int argc, char **argv) { break; default: - printf("renice [ngup] [id1 id2...]\n\t-n N Add N to the niceness\n\t-g Process group ids\n\t-u Process user names\n\t-p Process ids\n"); + puts("renice [ngup] [id1 id2...]\n\t-n N Add N to the niceness\n\t-g Process group ids\n\t-u Process user names\n\t-p Process ids"); return 0; } } diff --git a/src/coreutils/rm/rm.c b/src/coreutils/rm/rm.c index 616b269..a0a78b5 100644 --- a/src/coreutils/rm/rm.c +++ b/src/coreutils/rm/rm.c @@ -77,7 +77,7 @@ int main(int argc, char **argv) { break; default: - printf("rm [rif] [file1 file2...]\n\t-f Force\n\t-r Recursive\n\t-i Print prompt before remove\n"); + puts("rm [rif] [file1 file2...]\n\t-f Force\n\t-r Recursive\n\t-i Print prompt before remove"); return 0; } } diff --git a/src/coreutils/setsid/setsid.c b/src/coreutils/setsid/setsid.c index 09d5bb1..b471b6d 100644 --- a/src/coreutils/setsid/setsid.c +++ b/src/coreutils/setsid/setsid.c @@ -9,7 +9,7 @@ int main(int argc, char **argv) { UNUSED(argc); if (argv[1] == NULL) { - printf("setsid [cmd] [arg1 arg2...]\n"); + puts("setsid [cmd] [arg1 arg2...]"); return 1; } diff --git a/src/coreutils/shred/shred.c b/src/coreutils/shred/shred.c index 93c257a..4ba6a2c 100644 --- a/src/coreutils/shred/shred.c +++ b/src/coreutils/shred/shred.c @@ -68,7 +68,7 @@ int main(int argc, char **argv) { break; default: - printf("shred [fuzn] [file1 file2...]\n\t-n N Overwrite N times, default 3\n\t-z Final overwrite with zeros\n\t-u Remove file\n\t-f Chmod to ensure writability\n"); + puts("shred [fuzn] [file1 file2...]\n\t-n N Overwrite N times, default 3\n\t-z Final overwrite with zeros\n\t-u Remove file\n\t-f Chmod to ensure writability"); return 0; } } diff --git a/src/coreutils/sleep/sleep.c b/src/coreutils/sleep/sleep.c index 2d6a21a..17a21f9 100644 --- a/src/coreutils/sleep/sleep.c +++ b/src/coreutils/sleep/sleep.c @@ -9,7 +9,7 @@ int main(int argc, char **argv) { int opt; while ((opt = getopt(argc, argv, "")) != -1 || argc == 1) { - printf("sleep [num[SUFFIX]] or [inf Infinity]\nSUFFIXES:\n\tm - minute\n\th - hour\n\td - days\n"); + puts("sleep [num[SUFFIX]] / [inf]\nSUFFIXES:\n\tm - minute\n\th - hour\n\td - days"); return 0; } diff --git a/src/coreutils/split/split.c b/src/coreutils/split/split.c index 8b2243d..119694a 100644 --- a/src/coreutils/split/split.c +++ b/src/coreutils/split/split.c @@ -70,7 +70,7 @@ int main(int argc, char **argv) { break; default: - printf("split [alb] [file1]\n\t-l N Split by N lines\n\t-a N Use N letters as prefix\n\t-b N[k|m] Split by N (kilo|mega)bytes\n"); + puts("split [alb] [file1]\n\t-l N Split by N lines\n\t-a N Use N letters as prefix\n\t-b N[k|m] Split by N (kilo|mega)bytes"); return 0; } } diff --git a/src/coreutils/tee/tee.c b/src/coreutils/tee/tee.c index b82fdb5..8e24c75 100644 --- a/src/coreutils/tee/tee.c +++ b/src/coreutils/tee/tee.c @@ -22,7 +22,7 @@ int main(int argc, char **argv) { break; default: - printf("tee [ai] [file]\n\t-a Append\n\t-i Ignore interrupt signals\n"); + puts("tee [ai] [file]\n\t-a Append\n\t-i Ignore interrupt signals"); return 0; } } diff --git a/src/coreutils/time/time.c b/src/coreutils/time/time.c index 5ef1e1b..fad9cf9 100644 --- a/src/coreutils/time/time.c +++ b/src/coreutils/time/time.c @@ -9,7 +9,7 @@ int main(int argc, char **argv) { if (argc < 2) { - printf("time: missing operand\ntime [cmd]\n"); + puts("time: missing operand\ntime [cmd]"); return 0; } diff --git a/src/coreutils/touch/touch.c b/src/coreutils/touch/touch.c index b43a984..12a170b 100644 --- a/src/coreutils/touch/touch.c +++ b/src/coreutils/touch/touch.c @@ -126,7 +126,7 @@ int main(int argc, char **argv) { break; default: - printf("touch [cmad] [file1 file2...]\n\t-c Don't create files\n\t-a Change only atime\n\t-m Change only mtime\n\t-d Date/time to use\n"); + puts("touch [cmad] [file1 file2...]\n\t-c Don't create files\n\t-a Change only atime\n\t-m Change only mtime\n\t-d Date/time to use"); return 0; } } diff --git a/src/coreutils/uname/uname.c b/src/coreutils/uname/uname.c index 7094803..def6db0 100644 --- a/src/coreutils/uname/uname.c +++ b/src/coreutils/uname/uname.c @@ -102,7 +102,7 @@ int main(int argc, char **argv) { break; default: - printf("uname [asnrvmop]\n\t-a All\n\t-s Sys\n\t-n Nodename\n\t-r Release\n\t-v Version\n\t-m Machine\n\t-o Os name\n"); + puts("uname [asnrvmop]\n\t-a All\n\t-s Sys\n\t-n Nodename\n\t-r Release\n\t-v Version\n\t-m Machine\n\t-o Os name"); return 0; } } diff --git a/src/coreutils/wc/wc.c b/src/coreutils/wc/wc.c index cef6ed5..f100c35 100644 --- a/src/coreutils/wc/wc.c +++ b/src/coreutils/wc/wc.c @@ -84,7 +84,7 @@ int main(int argc, char **argv) { break; default: - printf("wc [lcwt] [file1 file2...]\n\t-l Lines\n\t-c Bytes\n\t-w Words\n\t-t Don't print total\n"); + puts("wc [lcwt] [file1 file2...]\n\t-l Lines\n\t-c Bytes\n\t-w Words\n\t-t Don't print total"); return 0; } } diff --git a/src/findutils/xargs/xargs.c b/src/findutils/xargs/xargs.c index 4b38578..6e0d652 100644 --- a/src/findutils/xargs/xargs.c +++ b/src/findutils/xargs/xargs.c @@ -266,7 +266,7 @@ int main(int argc, char **argv) { break; default: - printf("xargs [tnsrP0I] [cmd [arg1] [arg2...]\n\t-t Print the command before start\n\t-n Pass no more than N args\n\t-r Don't run command if input is empty\n\t-s Pass command line of no more than N bytes\n\t-0 NUL terminated input\n\t-I STR Replace STR within PROG ARGS with input line\n"); + puts("xargs [tnsrP0I] [cmd [arg1] [arg2...]\n\t-t Print the command before start\n\t-n Pass no more than N args\n\t-r Don't run command if input is empty\n\t-s Pass command line of no more than N bytes\n\t-0 NUL terminated input\n\t-I STR Replace STR within PROG ARGS with input line"); return 0; } } diff --git a/src/loginutils/cryptpw/cryptpw.c b/src/loginutils/cryptpw/cryptpw.c index 74179bf..ce2f32b 100644 --- a/src/loginutils/cryptpw/cryptpw.c +++ b/src/loginutils/cryptpw/cryptpw.c @@ -3,7 +3,7 @@ int main(int argc, char **argv) { if (argc < 2) { - printf("cryptpw: missing operand\ncryptpw [password] [own salt]\n"); + puts("cryptpw: missing operand\ncryptpw [password] [own salt]"); return 0; } diff --git a/src/loginutils/su/su.c b/src/loginutils/su/su.c index a02035b..3a4030c 100644 --- a/src/loginutils/su/su.c +++ b/src/loginutils/su/su.c @@ -105,7 +105,7 @@ int main(int argc, char **argv) { break; default: - printf("su [cps] [user Default: root]\n\t-c CMD Command to pass to \'sh -c\'\n\t-s SHELL Shell to use instead of user's default\n\t-p Do not set new env\n"); + puts("su [cps] [user Default: root]\n\t-c CMD Command to pass to \'sh -c\'\n\t-s SHELL Shell to use instead of user's default\n\t-p Do not set new env"); return 0; } } diff --git a/src/sysutils-linux/dmesg/dmesg.c b/src/sysutils-linux/dmesg/dmesg.c index 5e40f1a..e30d283 100644 --- a/src/sysutils-linux/dmesg/dmesg.c +++ b/src/sysutils-linux/dmesg/dmesg.c @@ -22,7 +22,7 @@ int main(int argc, char **argv) { break; default: - printf("dmesg [sn]\n\t-n LEVEL Set console logging level\n\t-s SIZE Buffer Size\n"); + puts("dmesg [sn]\n\t-n LEVEL Set console logging level\n\t-s SIZE Buffer Size"); return 0; } } diff --git a/src/sysutils-linux/mount/mount.c b/src/sysutils-linux/mount/mount.c index 2ac0280..df0ab5d 100644 --- a/src/sysutils-linux/mount/mount.c +++ b/src/sysutils-linux/mount/mount.c @@ -90,7 +90,7 @@ int main(int argc, char **argv) { break; default: - printf("mount [ato] [DEVICE] [NODE]\n\t-t Fs type, default %s\n\t-o Options\n\t-a Mount all fs in /etc/fstab\n\nOptions:\n", MOUNT_DEF_FS); + printf("mount [ato] [DEVICE] [NODE]\n\t-t Fs type, default %s\n\t-o Options\n\t-a Mount all fs in /etc/fstab\n\nOptions:", MOUNT_DEF_FS); print_opts(); return 0; } diff --git a/src/sysutils-linux/umount/umount.c b/src/sysutils-linux/umount/umount.c index ee7ec47..d04e2fe 100644 --- a/src/sysutils-linux/umount/umount.c +++ b/src/sysutils-linux/umount/umount.c @@ -50,7 +50,7 @@ int main(int argc, char **argv) { break; default: - printf("umount [afl] [dst1 dst2...]\n\t-a Umount all\n\t-f Force umount\n\t-l Lazy umount\n"); + puts("umount [afl] [dst1 dst2...]\n\t-a Umount all\n\t-f Force umount\n\t-l Lazy umount"); return 0; } }