From: Bret M. <ba...@mi...> - 2005-03-07 23:23:51
|
Below is the output of "cvs diff -u" for miranda.org:/usr/local/src/bwstat/ . My last two checkins fix the call to mail(1) by adding a -m option, having "/bin/mail" as the default, and specifying "-m /usr/bin/mail" in bwstat.debian. The change in background() seems like a good idea, but I'm not sure why it wasn't checked in. Should it be? --Bret Index: action.c =================================================================== RCS file: /cvsroot/bwstat/bwstat/action.c,v retrieving revision 1.5 diff -u -r1.5 action.c --- action.c 4 Mar 2004 13:27:44 -0000 1.5 +++ action.c 7 Mar 2005 23:20:16 -0000 @@ -1,6 +1,6 @@ /* action.c -- * Created: Wed Aug 23 16:11:27 2000 by fa...@al... - * Copyright 2000 Rickard E. Faith (fa...@al...) + * Copyright 2000, 2004 Rickard E. Faith (fa...@al...) * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -31,12 +31,16 @@ static void background(char *const cmd[], const char *filename) { int fd; + char buffer[256]; if (fork()) return; if ((fd = open(filename, O_CREAT|O_WRONLY, 0644)) < 0) exit(0); dup2(fd, STDOUT_FILENO); dup2(fd, STDERR_FILENO); execvp(cmd[0], cmd); + sprintf(buffer, "Cannot execvp, child pid=%d exiting\n", getpid()); + write(fd, buffer, strlen(buffer)); + close(fd); exit(0); } @@ -117,7 +121,7 @@ FILE *str; char buf[512]; - sprintf(buf, "/bin/mail -s '[bwstat] %s' %s", subject, email); + sprintf(buf, "/usr/bin/mail -s '[bwstat] %s' %s", subject, email); if (!(str = popen(buf, "w"))) return; print_header(data, str, 2); |