*
* Command-line utility to transmit a server command.
*
+ * Copyright (c) 1987-2009 by the citadel.org team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
{
FILE *lfp;
int onppid;
+ int rv;
if ((lfp = fopen(LOCKFILE, "r")) != NULL) {
- fscanf(lfp, "%d", &onppid);
+ rv = fscanf(lfp, "%d", &onppid);
fclose(lfp);
if (!kill(onppid, 0) || errno == EPERM)
return 1;
n = read(ipc->sock, rbuf, SIZ);
if (n>0) {
rbuf[n]='\0';
- fprintf (stderr, rbuf);
- fflush (stdout);
+ fprintf(stderr, "%s", rbuf);
+ fflush(stdout);
}
}
alarm(5); /* Kick the watchdog timer */