This commit is contained in:
parent
01357691db
commit
678f4bb7ef
@ -1,4 +1,101 @@
|
||||
--- .empty
|
||||
+++ .empty 2009-03-26 18:47:25.048001558 +0100
|
||||
@@ -0,0 +1 @@
|
||||
+remove if patch applied
|
||||
--- mkill.c
|
||||
+++ mkill.c 2009-04-29 12:55:49.480409712 +0200
|
||||
@@ -100,6 +100,7 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
const pid_t pid = getpid();
|
||||
const pid_t sid = getsid(0);
|
||||
+ const pid_t ppid = getppid();
|
||||
proc_t * this, *ptr, * last;
|
||||
struct dirent * dent;
|
||||
int dfd, num, nsig = SIGTERM;
|
||||
@@ -210,6 +211,9 @@ int main(int argc, char* argv[])
|
||||
if (sid == curr)
|
||||
continue;
|
||||
|
||||
+ if (ppid == curr)
|
||||
+ continue;
|
||||
+
|
||||
found = false;
|
||||
|
||||
strcpy(path, dent->d_name);
|
||||
@@ -308,6 +312,8 @@ int main(int argc, char* argv[])
|
||||
for (ptr = procs; this; ptr = this) {
|
||||
last = ptr->prev;
|
||||
this = ptr->next;
|
||||
+ if (ptr->pid != curr)
|
||||
+ continue;
|
||||
if (ptr == procs) {
|
||||
if (this) this->prev = (proc_t*)0;
|
||||
procs = this;
|
||||
--- usleep.c
|
||||
+++ usleep.c 2009-04-30 11:40:00.065901445 +0200
|
||||
@@ -20,20 +20,25 @@
|
||||
#ifdef __NO_STRING_INLINES
|
||||
# undef __NO_STRING_INLINES
|
||||
#endif
|
||||
+#include <errno.h>
|
||||
+#include <fcntl.h>
|
||||
#include <libgen.h>
|
||||
-#include <string.h>
|
||||
+#include <sched.h>
|
||||
+#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
+#include <string.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/stat.h>
|
||||
+#include <time.h>
|
||||
#include <unistd.h>
|
||||
-#ifdef _POSIX_PRIORITY_SCHEDULING
|
||||
-# include <sched.h>
|
||||
-#endif
|
||||
#define USAGE "Usage:\t%s [ microseconds ]\n", we_are
|
||||
|
||||
static char *we_are;
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
unsigned long int usec = 1;
|
||||
+ int fd;
|
||||
|
||||
if (argc > 2)
|
||||
goto err;
|
||||
@@ -45,12 +50,35 @@ int main(int argc, char **argv)
|
||||
goto err;
|
||||
}
|
||||
|
||||
- if (usec)
|
||||
+ if ((fd = open("/dev/null", O_RDWR|O_NOCTTY|O_CLOEXEC)) >= 0) {
|
||||
+ dup2(fd, 0);
|
||||
+ dup2(fd, 1);
|
||||
+ dup2(fd, 2);
|
||||
+ if (fd > 2) close(fd);
|
||||
+ }
|
||||
+
|
||||
+ if (usec) {
|
||||
+#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 199309L)
|
||||
+ struct timespec req = {0, 0}, rem = {0, 0};
|
||||
+ int ret;
|
||||
+
|
||||
+ while (usec >= 1000000UL) {
|
||||
+ req.tv_sec++;
|
||||
+ usec -= 1000000UL;
|
||||
+ }
|
||||
+ req.tv_nsec = usec * 1000;
|
||||
+
|
||||
+ do {
|
||||
+ ret = nanosleep(&req, &rem);
|
||||
+ if (ret == 0 || errno != EINTR)
|
||||
+ break;
|
||||
+ req = rem;
|
||||
+ } while (req.tv_nsec > 0 || req.tv_sec > 0);
|
||||
+#else
|
||||
usleep(usec);
|
||||
-#ifdef _POSIX_PRIORITY_SCHEDULING
|
||||
- else
|
||||
- (void)sched_yield();
|
||||
#endif
|
||||
+ } else
|
||||
+ (void)sched_yield();
|
||||
_exit(0);
|
||||
|
||||
/* Do this at the end for speed */
|
||||
|
@ -1,3 +1,13 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 30 11:42:34 CEST 2009 - werner@suse.de
|
||||
|
||||
- For usleep(8) use nanosleep(2) instead of obsolete usleep(3)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Apr 29 12:59:06 CEST 2009 - werner@suse.de
|
||||
|
||||
- mkill: Do not remove all pid's from list for one fuse process
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Apr 28 12:49:42 CEST 2009 - werner@suse.de
|
||||
|
||||
|
@ -30,7 +30,7 @@ Group: System/Base
|
||||
PreReq: coreutils
|
||||
AutoReqProv: on
|
||||
Version: 2.86
|
||||
Release: 205
|
||||
Release: 206
|
||||
Summary: SysV-Style init
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: libselinux-devel libsepol-devel
|
||||
@ -327,6 +327,10 @@ rm -rf ${RPM_BUILD_ROOT}
|
||||
%doc %{_mandir}/man8/mkill.8.gz
|
||||
|
||||
%changelog
|
||||
* Thu Apr 30 2009 werner@suse.de
|
||||
- For usleep(8) use nanosleep(2) instead of obsolete usleep(3)
|
||||
* Wed Apr 29 2009 werner@suse.de
|
||||
- mkill: Do not remove all pid's from list for one fuse process
|
||||
* Tue Apr 28 2009 werner@suse.de
|
||||
- Disable blogd on fastboot or quiet boot
|
||||
* Tue Apr 21 2009 werner@suse.de
|
||||
|
Loading…
Reference in New Issue
Block a user