Move cleanup() into the edit.c file which is the only users of that function
Remove common.{c,h}
This commit is contained in:
parent
f7a9447d0e
commit
a3cb40286e
@ -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
|
||||
|
@ -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);
|
||||
}
|
@ -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;
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user