diff options
author | Kiyoshi Aman <kiyoshi.aman+adelie@gmail.com> | 2019-05-16 11:47:54 -0500 |
---|---|---|
committer | Kiyoshi Aman <kiyoshi.aman+adelie@gmail.com> | 2019-05-16 11:47:54 -0500 |
commit | 5fa3142cdbb67cbb8287b2ec4fc35ee6532b3c6d (patch) | |
tree | 6abb866f965d62c64868a01950e53e0e6c21f06a /bin/dd/dd.c | |
parent | 5aef04248e45a1a0ce74d96e78abd871048369bf (diff) | |
download | userland-5fa3142cdbb67cbb8287b2ec4fc35ee6532b3c6d.tar.gz userland-5fa3142cdbb67cbb8287b2ec4fc35ee6532b3c6d.tar.bz2 userland-5fa3142cdbb67cbb8287b2ec4fc35ee6532b3c6d.tar.xz userland-5fa3142cdbb67cbb8287b2ec4fc35ee6532b3c6d.zip |
bin/dd: make buildable with libbsd
Diffstat (limited to 'bin/dd/dd.c')
-rw-r--r-- | bin/dd/dd.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/bin/dd/dd.c b/bin/dd/dd.c index c4fb1e8..aa2897d 100644 --- a/bin/dd/dd.c +++ b/bin/dd/dd.c @@ -33,20 +33,6 @@ * SUCH DAMAGE. */ -#include <sys/cdefs.h> -#ifndef lint -__COPYRIGHT("@(#) Copyright (c) 1991, 1993, 1994\ - The Regents of the University of California. All rights reserved."); -#endif /* not lint */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)dd.c 8.5 (Berkeley) 4/2/94"; -#else -__RCSID("$NetBSD: dd.c,v 1.51 2016/09/05 01:00:07 sevan Exp $"); -#endif -#endif /* not lint */ - #include <sys/param.h> #include <sys/stat.h> #include <sys/ioctl.h> @@ -61,6 +47,7 @@ __RCSID("$NetBSD: dd.c,v 1.51 2016/09/05 01:00:07 sevan Exp $"); #include <signal.h> #include <stdio.h> #include <stdlib.h> +#include <bsd/stdlib.h> #include <string.h> #include <unistd.h> @@ -135,10 +122,10 @@ main(int argc, char *argv[]) #endif setup(); - (void)signal(SIGINFO, summaryx); + (void)signal(SIGHUP, summaryx); (void)signal(SIGINT, terminate); (void)sigemptyset(&infoset); - (void)sigaddset(&infoset, SIGINFO); + (void)sigaddset(&infoset, SIGHUP); (void)atexit(summary); @@ -203,15 +190,14 @@ setup(void) #endif /* NO_IOFLAG */ #define OFLAGS \ (oflag | (ddflags & (C_SEEK | C_NOTRUNC) ? 0 : O_TRUNC)) - out.fd = ddop_open(out, out.name, O_RDWR | OFLAGS, DEFFILEMODE); + out.fd = ddop_open(out, out.name, O_RDWR | OFLAGS); /* * May not have read access, so try again with write only. * Without read we may have a problem if output also does * not support seeks. */ if (out.fd < 0) { - out.fd = ddop_open(out, out.name, O_WRONLY | OFLAGS, - DEFFILEMODE); + out.fd = ddop_open(out, out.name, O_WRONLY | OFLAGS); out.flags |= NOREAD; } if (out.fd < 0) { |