int user_id;
smallint quiet;
smallint signal_nr;
+ struct stat execstat;
};
#define G (*(struct globals*)&bb_common_bufsiz1)
#define found (G.found )
#define user_id (G.user_id )
#define quiet (G.quiet )
#define signal_nr (G.signal_nr )
+#define execstat (G.execstat )
#define INIT_G() \
do { \
user_id = -1; \
static int pid_is_exec(pid_t pid)
{
- struct stat st, execstat;
+ struct stat st;
char buf[sizeof("/proc//exe") + sizeof(int)*3];
sprintf(buf, "/proc/%u/exe", pid);
if (stat(buf, &st) < 0)
return 0;
- xstat(execname, &execstat);
if (st.st_dev == execstat.st_dev
&& st.st_ino == execstat.st_ino)
return 1;
if (errno)
user_id = xuname2uid(userspec);
}
+ if (execname)
+ xstat(execname, &execstat);
do_procinit(); /* Both start and stop needs to know current processes */