projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
594d5b5
)
Don't try to execute scripts unless they exist.
author
Guus Sliepen
<guus@tinc-vpn.org>
Sun, 24 Mar 2002 16:22:59 +0000
(16:22 +0000)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Sun, 24 Mar 2002 16:22:59 +0000
(16:22 +0000)
src/process.c
patch
|
blob
|
history
diff --git
a/src/process.c
b/src/process.c
index
a7f5d5f
..
0b17d7a
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.3
7 2002/03/19 00:07:0
9 guus Exp $
+ $Id: process.c,v 1.1.2.3
8 2002/03/24 16:22:5
9 guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-30,6
+30,7
@@
#include <syslog.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <syslog.h>
#include <sys/ioctl.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <unistd.h>
@@
-260,7
+261,13
@@
int execute_script(const char *name)
{
pid_t pid;
int status;
{
pid_t pid;
int status;
+ struct stat s;
cp
cp
+ /* First check if there is a script */
+
+ if(stat(name, &s))
+ return 0;
+
if((pid = fork()) < 0)
{
syslog(LOG_ERR, _("System call `%s' failed: %s"), "fork", strerror(errno));
if((pid = fork()) < 0)
{
syslog(LOG_ERR, _("System call `%s' failed: %s"), "fork", strerror(errno));