X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fsend.c;h=c454f7655fd9c5482d1c5db57bc13048976bfb69;hb=9677896bbb11f7b49ca3e1665601407b6c7a459f;hp=e39ab800e6a7c8569047cca2ff2a3eb61074dc90;hpb=3e300b97e9a54a3157e37948f8827abbe3eecf05;p=mmh diff --git a/uip/send.c b/uip/send.c index e39ab80..c454f76 100644 --- a/uip/send.c +++ b/uip/send.c @@ -16,21 +16,12 @@ #include #include -#ifdef TIME_WITH_SYS_TIME +#ifdef HAVE_SYS_TIME_H # include -# include -#else -# ifdef TM_IN_SYS_TIME -# include -# else -# include -# endif #endif +#include int debugsw = 0; /* global */ -int forwsw = 1; -int pushsw = 0; -int verbsw = 0; char *altmsg = NULL; char *annotext = NULL; char *distfile = NULL; @@ -50,10 +41,8 @@ static FILE *composition_file; /* composition file pointer */ /* ** static prototypes */ -static int sendsbr(char **, int, char *, struct stat *, int); +static int sendsbr(char **, int, char *, struct stat *); static void armed_done(int) NORETURN; -static void alert(char *, int); -static int tmp_fd(void); static void anno(struct stat *); static int sendaux(char **, int, char *, struct stat *); static int attach(char *); @@ -67,25 +56,13 @@ static struct swit switches[] = { { "alias aliasfile", 0 }, #define DEBUGSW 1 { "debug", -5 }, -#define FORWSW 2 - { "forward", 0 }, -#define NFORWSW 3 - { "noforward", 0 }, -#define PUSHSW 4 - { "push", 0 }, -#define NPUSHSW 5 - { "nopush", 0 }, -#define VERBSW 6 +#define VERBSW 2 { "verbose", 0 }, -#define NVERBSW 7 - { "noverbose", 0 }, -#define WATCSW 8 - { "watch", 0 }, -#define NWATCSW 9 - { "nowatch", 0 }, -#define VERSIONSW 10 - { "version", 0 }, -#define HELPSW 11 +#define NVERBSW 3 + { "noverbose", 2 }, +#define VERSIONSW 4 + { "Version", 0 }, +#define HELPSW 5 { "help", 0 }, { NULL, 0 } }; @@ -106,10 +83,7 @@ main(int argc, char **argv) struct stat st; struct stat st2; - -#ifdef LOCALE setlocale(LC_ALL, ""); -#endif invo_name = mhbasename(argv[0]); /* read user profile/context */ @@ -140,33 +114,11 @@ main(int argc, char **argv) print_version(invo_name); done(1); - case PUSHSW: - pushsw++; - continue; - case NPUSHSW: - pushsw = 0; - continue; - - case FORWSW: - forwsw++; - continue; - case NFORWSW: - forwsw = 0; - continue; - + case DEBUGSW: + debugsw++; + /* fall */ case VERBSW: - verbsw++; - vec[vecp++] = --cp; - continue; case NVERBSW: - verbsw = 0; - vec[vecp++] = --cp; - continue; - - case DEBUGSW: - debugsw++; /* fall */ - case WATCSW: - case NWATCSW: vec[vecp++] = --cp; continue; @@ -273,36 +225,6 @@ main(int argc, char **argv) st.st_dev = 0; st.st_ino = 0; } - if (pushsw) { - /* push a fork into the background */ - pid_t pid; - - switch (pid = fork()) { - case -1: - /* fork error */ - advise(NULL, "unable to fork, so can't push..."); - break; - - default: - /* parent, just exit */ - done(0); - - case 0: - /* child, block a few signals and continue */ - SIGNAL(SIGHUP, SIG_IGN); - SIGNAL(SIGINT, SIG_IGN); - SIGNAL(SIGQUIT, SIG_IGN); - SIGNAL(SIGTERM, SIG_IGN); -#ifdef SIGTSTP - SIGNAL(SIGTSTP, SIG_IGN); - SIGNAL(SIGTTIN, SIG_IGN); - SIGNAL(SIGTTOU, SIG_IGN); -#endif - freopen("/dev/null", "r", stdin); - freopen("/dev/null", "w", stdout); - break; - } - } status = 0; vec[0] = "spost"; for (n=3; n