← Commit list

8cedabaee

Rob Landley
Rob Landley
2006-09-04
SOURCE BUG Duration: 44s

Subject

Patch from Natanael Copa to make start-stop-daemon just use readlink and strcmp to check if a program is already running.

SOURCE BUG

This commit was genuinely broken at the time (not related to our build system): scripts/config/mkconfigs.c (2005-08-01 - 2006-10-05 arasi) uretilen bbconfigopts.h icine .config satirlarini kacissiz, ham newline'larla gömüyordu - gecerli C degildi, busybox'un kendi bb_mkdep araci bile parse edemiyordu (7d219aab7 ile duzeltildi, mkconfigs shell scripte cevrildi)

→ Bu hatanin tam hikayesini ve duzeltme diffini gor

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

debianutils/start_stop_daemon.c+9 -8
@@ -39,16 +39,17 @@ static inline void push(pid_t pid)
static int pid_is_exec(pid_t pid, const char *name)
{
- char buf[32];
- struct stat sb, exec_stat;
-
- if (name)
- xstat(name, &exec_stat);
+ char buf[32], *execbuf;
+ int equal;
sprintf(buf, "/proc/%d/exe", pid);
- if (stat(buf, &sb) != 0)
- return 0;
- return (sb.st_dev == exec_stat.st_dev && sb.st_ino == exec_stat.st_ino);
+ execbuf = xstrdup(name);
+ readlink(buf, execbuf, strlen(name)+1);
+
+ equal = ! strcmp(execbuf, name);
+ if (ENABLE_FEATURE_CLEAN_UP)
+ free(execbuf);
+ return equal;
}
static int pid_is_user(int pid, int uid)