PIDs are of type pid_t, and use %ld when reading/writing them to the pidfile.

This commit is contained in:
Guus Sliepen 2003-10-06 16:13:08 +00:00
parent e898b930dc
commit 5900c07fab
6 changed files with 25 additions and 42 deletions

View file

@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
$Id: logger.c,v 1.1.2.11 2003/08/17 12:04:35 guus Exp $
$Id: logger.c,v 1.1.2.12 2003/10/06 16:13:07 guus Exp $
*/
#include "system.h"
@ -78,7 +78,7 @@ void logger(int priority, const char *format, ...) {
fflush(stderr);
break;
case LOGMODE_FILE:
fprintf(logfile, "%ld %s[%d]: ", time(NULL), logident, logpid);
fprintf(logfile, "%ld %s[%ld]: ", time(NULL), logident, (long)logpid);
vfprintf(logfile, format, ap);
fprintf(logfile, "\n");
fflush(logfile);

View file

@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
$Id: process.c,v 1.1.2.75 2003/08/22 15:07:57 guus Exp $
$Id: process.c,v 1.1.2.76 2003/10/06 16:13:08 guus Exp $
*/
#include "system.h"
@ -58,19 +58,6 @@ static void memory_full(int size)
/* Some functions the less gifted operating systems might lack... */
#ifndef HAVE_FCLOSEALL
static int fcloseall(void)
{
fflush(stdin);
fflush(stdout);
fflush(stderr);
fclose(stdin);
fclose(stdout);
fclose(stderr);
return 0;
}
#endif
#ifdef HAVE_MINGW
extern char *identname;
extern char *program_name;
@ -254,7 +241,7 @@ bool init_service(void) {
*/
static bool write_pidfile(void)
{
int pid;
pid_t pid;
cp();
@ -262,10 +249,10 @@ static bool write_pidfile(void)
if(pid) {
if(netname)
fprintf(stderr, _("A tincd is already running for net `%s' with pid %d.\n"),
netname, pid);
fprintf(stderr, _("A tincd is already running for net `%s' with pid %ld.\n"),
netname, (long)pid);
else
fprintf(stderr, _("A tincd is already running with pid %d.\n"), pid);
fprintf(stderr, _("A tincd is already running with pid %ld.\n"), (long)pid);
return false;
}
@ -283,7 +270,7 @@ static bool write_pidfile(void)
bool kill_other(int signal)
{
#ifndef HAVE_MINGW
int pid;
pid_t pid;
cp();

View file

@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
$Id: tincd.c,v 1.10.4.88 2003/09/25 10:34:16 guus Exp $
$Id: tincd.c,v 1.10.4.89 2003/10/06 16:13:08 guus Exp $
*/
#include "system.h"
@ -39,6 +39,7 @@
#include <lzo1x.h>
#include <getopt.h>
#include <pidfile.h>
#include "conf.h"
#include "device.h"