projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Initialize vecp in send anno()
[mmh]
/
uip
/
rcvdist.c
diff --git
a/uip/rcvdist.c
b/uip/rcvdist.c
index
58bf62d
..
d3e4100
100644
(file)
--- a/
uip/rcvdist.c
+++ b/
uip/rcvdist.c
@@
-14,9
+14,9
@@
static struct swit switches[] = {
#define FORMSW 0
static struct swit switches[] = {
#define FORMSW 0
- { "form formfile", 4 },
+ { "form formfile", 0 },
#define VERSIONSW 1
#define VERSIONSW 1
- { "version", 0 },
+ { "Version", 0 },
#define HELPSW 2
{ "help", 0 },
{ NULL, 0 }
#define HELPSW 2
{ "help", 0 },
{ NULL, 0 }
@@
-30,7
+30,7
@@
static char tmpfil[BUFSIZ] = "";
** prototypes
*/
static void rcvdistout(FILE *, char *, char *);
** prototypes
*/
static void rcvdistout(FILE *, char *, char *);
-static void unlink_done(int) NORETURN;
+static void unlink_done();
int
int
@@
-42,11
+42,9
@@
main(int argc, char **argv)
FILE *fp;
char *tfile = NULL;
FILE *fp;
char *tfile = NULL;
- done=unlink_done;
+ atexit(unlink_done);
-#ifdef LOCALE
setlocale(LC_ALL, "");
setlocale(LC_ALL, "");
-#endif
invo_name = mhbasename(argv[0]);
/* read user profile/context */
invo_name = mhbasename(argv[0]);
/* read user profile/context */
@@
-60,18
+58,18
@@
main(int argc, char **argv)
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
- done(1);
+ exit(1);
case UNKWNSW:
vec[vecp++] = --cp;
continue;
case HELPSW:
case UNKWNSW:
vec[vecp++] = --cp;
continue;
case HELPSW:
- snprintf(buf, sizeof(buf), "%s [switches] [switches for postproc] address ...", invo_name);
+ snprintf(buf, sizeof(buf), "%s [switches] [switches for spost] address ...", invo_name);
print_help(buf, switches, 1);
print_help(buf, switches, 1);
- done(1);
+ exit(0);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
- done(1);
+ exit(0);
case FORMSW:
if (!(form = *argp++) || *form == '-') {
case FORMSW:
if (!(form = *argp++) || *form == '-') {
@@
-85,7
+83,7
@@
main(int argc, char **argv)
}
if (!addrs) {
}
if (!addrs) {
- adios(NULL, "usage: %s [switches] [switches for postproc] address ...", invo_name);
+ adios(NULL, "usage: %s [switches] [switches for spost] address ...", invo_name);
}
umask(~m_gmprot());
}
umask(~m_gmprot());
@@
-105,17
+103,18
@@
main(int argc, char **argv)
fclose(fp);
if (distout(drft, tmpfil, backup) == NOTOK) {
fclose(fp);
if (distout(drft, tmpfil, backup) == NOTOK) {
- done(1);
+ /* sysexits.h EX_DATAERR */
+ exit(1);
}
}
- vec[0] = mhbasename(postproc);
+ vec[0] = "spost";
vec[vecp++] = "-dist";
vec[vecp++] = drft;
vec[vecp] = NULL;
vec[vecp++] = "-dist";
vec[vecp++] = drft;
vec[vecp] = NULL;
- execvp(postproc, vec);
+ execvp(*vec, vec);
fprintf(stderr, "unable to exec ");
fprintf(stderr, "unable to exec ");
- perror(postproc);
+ perror(*vec);
_exit(1);
return 0; /* dead code to satisfy the compiler */
}
_exit(1);
return 0; /* dead code to satisfy the compiler */
}
@@
-277,7
+276,7
@@
finished: ;
static void
static void
-unlink_done(int status)
+unlink_done()
{
if (*backup) {
unlink(backup);
{
if (*backup) {
unlink(backup);
@@
-288,5
+287,4
@@
unlink_done(int status)
if (*tmpfil) {
unlink(tmpfil);
}
if (*tmpfil) {
unlink(tmpfil);
}
- exit(status ? RCV_MBX : RCV_MOK);
}
}