]> arthur.barton.de Git - netatalk.git/commitdiff
Remove timeout. See bug #2683367
authorfranklahm <franklahm>
Tue, 17 Mar 2009 09:05:41 +0000 (09:05 +0000)
committerfranklahm <franklahm>
Tue, 17 Mar 2009 09:05:41 +0000 (09:05 +0000)
contrib/printing/Makefile.am
contrib/printing/timeout.c [deleted file]
man/man1/Makefile.am
man/man1/timeout.1 [deleted file]

index f2f4a911e053b7f0c85d16f551f6c0f4cc40860d..7b375ab18d0a4758e3ba4bee10dc34a00633366e 100644 (file)
@@ -1,6 +1,2 @@
 # Makefile.am for contrib/printing/
 
-bin_PROGRAMS = timeout
-
-timeout_SOURCES = timeout.c
-timeout_LDADD = $(top_builddir)/libatalk/libatalk.la
diff --git a/contrib/printing/timeout.c b/contrib/printing/timeout.c
deleted file mode 100644 (file)
index ee7fb09..0000000
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * $Id: timeout.c,v 1.4.14.1 2004-05-21 14:19:59 didg Exp $
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <signal.h>
-#include <ctype.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-
-char **av;
-
-struct slist {
-       char *name;
-       int num;
-} sigs[] = {
-#ifdef SIGHUP
-       { "HUP",        SIGHUP },
-#endif
-#ifdef SIGINT
-       { "INT",        SIGINT },
-#endif
-#ifdef SIGQUIT
-       { "QUIT",       SIGQUIT },
-#endif
-#ifdef SIGILL
-       { "ILL",        SIGILL },
-#endif
-#ifdef SIGTRAP
-       { "TRAP",       SIGTRAP },
-#endif
-#ifdef SIGABRT
-       { "ABRT",       SIGABRT },
-#endif
-#ifdef SIGIOT
-       { "IOT",        SIGIOT },
-#endif
-#ifdef SIGEMT
-       { "EMT",        SIGEMT },
-#endif
-#ifdef SIGFPE
-       { "FPE",        SIGFPE },
-#endif
-#ifdef SIGKILL
-       { "KILL",       SIGKILL },
-#endif
-#ifdef SIGBUS
-       { "BUS",        SIGBUS },
-#endif
-#ifdef SIGSEGV
-       { "SEGV",       SIGSEGV },
-#endif
-#ifdef SIGSYS
-       { "SYS",        SIGSYS },
-#endif
-#ifdef SIGPIPE
-       { "PIPE",       SIGPIPE },
-#endif
-#ifdef SIGALRM
-       { "ALRM",       SIGALRM },
-#endif
-#ifdef SIGTERM
-       { "TERM",       SIGTERM },
-#endif
-#ifdef SIGURG
-       { "URG",        SIGURG },
-#endif
-#ifdef SIGSTOP
-       { "STOP",       SIGSTOP },
-#endif
-#ifdef SIGTSTP
-       { "TSTP",       SIGTSTP },
-#endif
-#ifdef SIGCONT
-       { "CONT",       SIGCONT },
-#endif
-#ifdef SIGCHLD
-       { "CHLD",       SIGCHLD },
-#endif
-#ifdef SIGCLD
-       { "CLD",        SIGCLD },
-#endif
-#ifdef SIGTTIN
-       { "TTIN",       SIGTTIN },
-#endif
-#ifdef SIGTTOU
-       { "TTOU",       SIGTTOU },
-#endif
-#ifdef SIGIO
-       { "IO",         SIGIO },
-#endif
-#ifdef SIGXCPU
-       { "XCPU",       SIGXCPU },
-#endif
-#ifdef SIGXFSZ
-       { "XFSZ",       SIGXFSZ },
-#endif
-#ifdef SIGVTALRM
-       { "VTALRM",     SIGVTALRM },
-#endif
-#ifdef SIGPROF
-       { "PROF",       SIGPROF },
-#endif
-#ifdef SIGWINCH
-       { "WINCH",      SIGWINCH },
-#endif
-#ifdef SIGINFO
-       { "INFO",       SIGINFO },
-#endif
-#ifdef SIGUSR1
-       { "USR1",       SIGUSR1 },
-#endif
-#ifdef SIGUSR2
-       { "USR2",       SIGUSR2 },
-#endif
-#ifdef SIGPWR
-       { "PWR",        SIGPWR },
-#endif
-       { 0,            0 }
-};
-
-void
-usage()
-{
-       int i;
-
-       fprintf (stderr, "Usage: %s [-s signal] seconds program [args]\n\n",
-                *av);
-       fprintf (stderr, "You can use a numerical signal, or one of these:\n");
-
-#define COLS 8
-
-       for (i = 0; sigs[i].name; i++) {
-               if (i % COLS == 0)
-                       fprintf (stderr, "\n\t");
-
-               fprintf (stderr, "%s", sigs[i].name);
-
-               if ((i + 1) % COLS != 0)
-                       fprintf (stderr, "\t");
-       }
-
-       fprintf (stderr, "\n\n");
-}
-
-int
-main (argc, argv)
-       int argc;
-       char **argv;
-{
-       int i;
-       int whatsig = SIGTERM;
-       extern char *optarg;
-       extern int optind;
-       int pid;
-
-       av = argv;
-
-       while ((i = getopt (argc, argv, "+s:")) != -1) {
-
-               switch (i) {
-               case 's':
-                       if (isdigit (*optarg)) {
-                               whatsig = atoi (optarg);
-                       } else {
-                               for (i = 0; sigs[i].name; i++) {
-                                       if (!strcmp (sigs[i].name, optarg)) {
-                                               whatsig = sigs[i].num;
-                                               break;
-                                       }
-                               }
-
-                               if (!sigs[i].name) {
-                                       fprintf (stderr, 
-                                                "%s: Unknown signal %s\n",
-                                                *av, optarg);
-                                       usage();
-                                       exit (1);
-                               }
-                       }
-
-                       break;
-
-               default:
-                       usage();
-                       exit (1);
-               }
-       }
-
-       if (optind > argc - 2) {
-               usage();
-               exit (1);
-       }
-
-       if (!isdigit (*argv[optind])) {
-               fprintf (stderr, "%s: \"seconds\" must be numeric, not %s\n",
-                        *av, argv[optind]);
-               usage();
-               exit (1);
-       }
-
-       pid = fork();
-
-       if (pid < 0) {
-               fprintf (stderr, "%s: fork failed: ", *av);
-               perror ("fork");
-               exit (1);
-       } else if (pid == 0) {
-               int seconds = atoi (argv[optind]);
-
-               pid = getppid();
-
-               fclose (stdin);
-               fclose (stdout);
-               fclose (stderr);
-
-               while (seconds-- > 0) {
-                       /*
-                        * too bad there's no SIGPARENT so we have to keep
-                        * polling to find out if it's still there
-                        */
-
-                       if (kill (pid, 0) != 0)
-                               exit (0);
-
-                       sleep (1);
-               }
-
-               kill (pid, whatsig);
-               exit (0);
-       } else {
-               execvp (argv[optind + 1], argv + optind + 1);
-
-               fprintf (stderr, "%s: can't execute ", *av);
-               perror (argv[optind + 1]);
-               exit (1);
-       }
-}
index 1e6013ceefeb1ea064af25a2b915201f2bf56655..f02ba61c18478b6bf5eb4957e378651888eb1a9d 100644 (file)
@@ -32,7 +32,6 @@ NONGENERATED_MANS     =       achfile.1  \
                                papstatus.1 \
                                psorder.1 \
                                single2bin.1 \
-                               timeout.1 \
                                unbin.1 \
                                unhex.1 \
                                unsingle.1 \
diff --git a/man/man1/timeout.1 b/man/man1/timeout.1
deleted file mode 100644 (file)
index 94f7abf..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-.TH timeout 1 "19 Jul 2001" 2.0.3 Netatalk 
-.SH NAME
-timeout \- Send a signal to a program after a certain time
-.SH SYNTAX
-timeout [\-s \fIsignal\fR] \fIseconds\fR \fIprogram\fR [\fIargs\fR]
-.SH DESCRIPTION
-\fItimeout\fR executes a \fIprogram\fR (with arguments \fIargs\fR)
-and sends a \fIsignal\fR to it after a certain
-amount of \fIseconds\fR.
-.SH OPTIONS
-.TP 
-\fB\-s\fR \fIsignal\fR
-Signal to send to the spawned process. This can be a numerical
-or symbolic ID. This defaults to \fBTERM\fR.
-.SH EXAMPLES
-.TP 
-timeout 10 pap foo.ps
-Execute "pap foo.ps" and send a SIGTERM
-if \fIpap\fR doesn't return after 10
-seconds.
-.TP 
-timeout \-s HUP 60 sh
-Spawn a shell and send a hangup signal after one minute.
-.TP 
-timeout \-s 9 10 evilprog
-Execute a program and \fIKILL\fR it
-if it doesn't quit after 10 seconds.
-