Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 139179 | Differences between
and this patch

Collapse All | Expand All

(-)dhcpcd-2.0.5/src/client.c (-4 lines)
Lines 99-106 Link Here
99
int	deleteDhcpCache();
91
int	deleteDhcpCache();
100
void	execute_on_change(char *prm);
92
void	execute_on_change(char *prm);
101
93
102
int	execOnStop	= 1;
103
104
int			dhcpSocket;
94
int			dhcpSocket;
105
int			udpFooSocket;
95
int			udpFooSocket;
106
int			prev_ip_addr;
96
int			prev_ip_addr;
Lines 1307-1314 Link Here
1307
  if ( ntp_renamed )
1308
  if ( ntp_renamed )
1308
    rename(ntp_file_sv, ntp_file);
1309
    rename(ntp_file_sv, ntp_file);
1309
1310
1310
  if ( ! execOnStop ) return &dhcpStart;
1311
1312
  if ( ! stat("/sbin/resolvconf", &buf) )
1311
  if ( ! stat("/sbin/resolvconf", &buf) )
1313
    {
1312
    {
1314
#ifdef EMBED
1313
#ifdef EMBED
(-)dhcpcd-2.0.5/src/signals.c (-9 / +17 lines)
Lines 43-48 Link Here
43
extern void		*(*currState)();
43
extern void		*(*currState)();
44
extern int		execOnStop;
44
extern int		execOnStop;
45
45
46
jmp_buf			jmpTerm;
47
46
/*****************************************************************************/
48
/*****************************************************************************/
47
void killPid(sig)
49
void killPid(sig)
48
int sig;
50
int sig;
Lines 127-142 Link Here
127
	}
129
	}
128
	logger(LOG_ERR, "terminating on signal %d",sig);
130
	logger(LOG_ERR, "terminating on signal %d",sig);
129
    }
131
    }
130
  if (!Persistent || sig != SIGTERM)
132
  if (sig == SIGTERM) siglongjmp(jmpTerm, 1);
131
    {
133
  if (!Persistent) dhcpStop();
132
      /* Disable execing programs on SIGTERM as if any services get restarted then
133
       * they get hung and are un-useable even though they do get restarted and
134
       * apparently without error. Fix this, as it as a dhcpcd error! */
135
      if (sig == SIGTERM) execOnStop = 0;
136
      dhcpStop();
137
    }
138
  deletePidFile();
134
  deletePidFile();
139
  exit(sig);
135
136
  /* Exit with 0 if we were told to quit, otherwise the SIG code */
137
  if (sig == SIGQUIT || sig == SIGINT || sig == SIGHUP)
138
    exit(0);
139
  else
140
    exit(sig);
140
}
141
}
141
/*****************************************************************************/
142
/*****************************************************************************/
142
void signalSetup()
143
void signalSetup()
Lines 148-151 Link Here
148
  action.sa_flags = 0;
149
  action.sa_flags = 0;
149
  for (i=1;i<16;i++) sigaction(i,&action,NULL);
150
  for (i=1;i<16;i++) sigaction(i,&action,NULL);
150
  sigaction(SIGCHLD,&action,NULL);
151
  sigaction(SIGCHLD,&action,NULL);
152
153
  /* We do this so that we can call external programs safely from a SIGTERM */
154
  if ( sigsetjmp(jmpTerm, 1) ) {
155
    if (!Persistent) dhcpStop();
156
    deletePidFile();
157
    exit(0);
158
  }
151
}
159
}

Return to bug 139179