projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
PIDs are of type pid_t, and use %ld when reading/writing them to the pidfile.
[tinc]
/
src
/
process.c
diff --git
a/src/process.c
b/src/process.c
index
35296f0
..
a5abc93
100644
(file)
--- a/
src/process.c
+++ b/
src/process.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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.7
3 2003/08/17 12:05
:08 guus Exp $
+ $Id: process.c,v 1.1.2.7
6 2003/10/06 16:13
:08 guus Exp $
*/
#include "system.h"
*/
#include "system.h"
@@
-58,19
+58,6
@@
static void memory_full(int size)
/* Some functions the less gifted operating systems might lack... */
/* 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;
#ifdef HAVE_MINGW
extern char *identname;
extern char *program_name;
@@
-82,7
+69,7
@@
static SERVICE_STATUS status = {0};
static SERVICE_STATUS_HANDLE statushandle = 0;
bool install_service(void) {
static SERVICE_STATUS_HANDLE statushandle = 0;
bool install_service(void) {
- char command[4096] = "";
+ char command[4096] = "
\"
";
char **argp;
bool space;
SERVICE_DESCRIPTION description = {"Virtual Private Network daemon"};
char **argp;
bool space;
SERVICE_DESCRIPTION description = {"Virtual Private Network daemon"};
@@
-93,10
+80,8
@@
bool install_service(void) {
return false;
}
return false;
}
- strncat(command, "\"", sizeof(command));
-
if(!strchr(program_name, '\\')) {
if(!strchr(program_name, '\\')) {
- GetCurrentDirectory(sizeof(command)
, command
);
+ GetCurrentDirectory(sizeof(command)
- 1, command + 1
);
strncat(command, "\\", sizeof(command));
}
strncat(command, "\\", sizeof(command));
}
@@
-256,7
+241,7
@@
bool init_service(void) {
*/
static bool write_pidfile(void)
{
*/
static bool write_pidfile(void)
{
-
in
t pid;
+
pid_
t pid;
cp();
cp();
@@
-264,10
+249,10
@@
static bool write_pidfile(void)
if(pid) {
if(netname)
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 %
l
d.\n"),
+ netname,
(long)
pid);
else
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;
}
return false;
}
@@
-285,7
+270,7
@@
static bool write_pidfile(void)
bool kill_other(int signal)
{
#ifndef HAVE_MINGW
bool kill_other(int signal)
{
#ifndef HAVE_MINGW
-
in
t pid;
+
pid_
t pid;
cp();
cp();