diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2016-10-15 13:45:09 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2016-10-15 13:45:09 +0000 |
commit | db1fcc80089e8723047ff2a15069b43692e7477c (patch) | |
tree | dd19d0eb1de0642c175281a25e60699b3ee46003 /usr.bin/sdiff | |
parent | e8ad1a6f3daefaeb914afccaaa92b070546ccf1b (diff) | |
download | src-db1fcc80089e8723047ff2a15069b43692e7477c.tar.gz src-db1fcc80089e8723047ff2a15069b43692e7477c.zip |
Move cleanup() into the edit.c file which is the only users of that function
Remove common.{c,h}
Notes
Notes:
svn path=/head/; revision=307372
Diffstat (limited to 'usr.bin/sdiff')
-rw-r--r-- | usr.bin/sdiff/Makefile | 2 | ||||
-rw-r--r-- | usr.bin/sdiff/common.c | 24 | ||||
-rw-r--r-- | usr.bin/sdiff/common.h | 9 | ||||
-rw-r--r-- | usr.bin/sdiff/edit.c | 10 |
4 files changed, 10 insertions, 35 deletions
diff --git a/usr.bin/sdiff/Makefile b/usr.bin/sdiff/Makefile index 504adc2a663e..f4772cc3da59 100644 --- a/usr.bin/sdiff/Makefile +++ b/usr.bin/sdiff/Makefile @@ -3,7 +3,7 @@ .include <src.opts.mk> PROG= sdiff -SRCS= common.c edit.c sdiff.c +SRCS= edit.c sdiff.c WARNS= 3 MAN1= sdiff.1 diff --git a/usr.bin/sdiff/common.c b/usr.bin/sdiff/common.c deleted file mode 100644 index 686965c32b99..000000000000 --- a/usr.bin/sdiff/common.c +++ /dev/null @@ -1,24 +0,0 @@ -/* $OpenBSD: common.c,v 1.4 2006/05/25 03:20:32 ray Exp $ */ - -/* - * Written by Raymond Lai <ray@cyth.net>. - * Public domain. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <err.h> -#include <stdlib.h> -#include <unistd.h> - -#include "common.h" - -void -cleanup(const char *filename) -{ - - if (unlink(filename)) - err(2, "could not delete: %s", filename); - exit(2); -} diff --git a/usr.bin/sdiff/common.h b/usr.bin/sdiff/common.h deleted file mode 100644 index 127c1f4b70f2..000000000000 --- a/usr.bin/sdiff/common.h +++ /dev/null @@ -1,9 +0,0 @@ -/* $OpenBSD: common.h,v 1.2 2006/05/25 03:20:32 ray Exp $ */ -/* $FreeBSD$ */ - -/* - * Written by Raymond Lai <ray@cyth.net>. - * Public domain. - */ - -void cleanup(const char *) __dead2; diff --git a/usr.bin/sdiff/edit.c b/usr.bin/sdiff/edit.c index 7c01889d3551..993b515c49b5 100644 --- a/usr.bin/sdiff/edit.c +++ b/usr.bin/sdiff/edit.c @@ -21,9 +21,17 @@ __FBSDID("$FreeBSD$"); #include <string.h> #include <unistd.h> -#include "common.h" #include "extern.h" +static void +cleanup(const char *filename) +{ + + if (unlink(filename)) + err(2, "could not delete: %s", filename); + exit(2); +} + /* * Execute an editor on the specified pathname, which is interpreted * from the shell. This means flags may be included. |