aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-08-22 17:33:03 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-08-22 17:33:03 +0200
commit352f413762a28005f5d892d7d1cd2b368ba7cca8 (patch)
treeef3c996e15e5fde2c5659325fd1d95af314cd6be
parent1c1b3b92ffa42824a77a21a5ef35e9976b034e84 (diff)
Cleanup
-rw-r--r--Makefile2
-rw-r--r--Makefile.linux7
-rw-r--r--watch.c22
3 files changed, 9 insertions, 22 deletions
diff --git a/Makefile b/Makefile
index 73e21e4..1979014 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,3 @@
-# $Id$
-
PROG= watch
BINDIR= /usr/local/bin
MAN= watch.1
diff --git a/Makefile.linux b/Makefile.linux
new file mode 100644
index 0000000..03a17a6
--- /dev/null
+++ b/Makefile.linux
@@ -0,0 +1,7 @@
+PROG = watch
+LDFLAGS += -lncurses -lbsd
+
+all: ${PROG}
+
+clean:
+ ${RM} ${PROG} *.o
diff --git a/watch.c b/watch.c
index 23d369e..d927286 100644
--- a/watch.c
+++ b/watch.c
@@ -1,4 +1,3 @@
-/* $Id$ */
/*
* Copyright (c) 2003 Dimitri Sokolyuk <demon@dim13.org>
*
@@ -15,15 +14,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifndef lint
-static const char rcsid[] =
-"$Id$";
-#endif /* not lint */
-
-/* version */
-const int major = 2;
-const int minor = 1;
-
#include <sys/ioctl.h>
#include <sys/time.h>
#include <sys/wait.h>
@@ -38,14 +28,6 @@ const int minor = 1;
#include <unistd.h>
#include <sysexits.h>
-#if defined(__linux__)
-#ifndef __dead
-#define __dead __attribute__((noreturn))
-#endif
-#define strlcpy(d,s,l) (strncpy(d,s,(l) - strlen(d) - 1), (d)[(l) - 1] = '\0')
-#define strlcat(d,s,l) strncat(d,s,(l) - strlen(d) - 1)
-#endif
-
#ifndef DELAY
#define DELAY 2 /* default delay between screen updates in seconds */
#endif
@@ -64,7 +46,7 @@ int display(WINDOW *, char *, char *, size_t);
void title(WINDOW *, char *, int);
void resize(void);
void settimer(int);
-__dead void usage(void);
+void usage(void);
void
catchsig(int sig)
@@ -285,7 +267,7 @@ settimer(int sec)
setitimer(ITIMER_REAL, &itv, NULL);
}
-__dead void
+void
usage(void)
{
(void)fprintf(stderr, "usage: %s [-htv] [-n time] [command]\n",