SecBSD's official ports repository
This commit is contained in:
commit
2c0afcbbf3
64331 changed files with 5339189 additions and 0 deletions
56
sysutils/squashfs-tools/patches/patch-squashfs-tools_info_c
Normal file
56
sysutils/squashfs-tools/patches/patch-squashfs-tools_info_c
Normal file
|
@ -0,0 +1,56 @@
|
|||
https://github.com/plougher/squashfs-tools/pull/69
|
||||
|
||||
Index: squashfs-tools/info.c
|
||||
--- squashfs-tools/info.c.orig
|
||||
+++ squashfs-tools/info.c
|
||||
@@ -144,31 +144,22 @@ void dump_state()
|
||||
void *info_thrd(void *arg)
|
||||
{
|
||||
sigset_t sigmask;
|
||||
- struct timespec timespec = { .tv_sec = 1, .tv_nsec = 0 };
|
||||
- int sig, waiting = 0;
|
||||
+ int sig, err, waiting = 0;
|
||||
|
||||
sigemptyset(&sigmask);
|
||||
sigaddset(&sigmask, SIGQUIT);
|
||||
sigaddset(&sigmask, SIGHUP);
|
||||
+ sigaddset(&sigmask, SIGALRM);
|
||||
|
||||
while(1) {
|
||||
- if(waiting)
|
||||
- sig = sigtimedwait(&sigmask, NULL, ×pec);
|
||||
- else
|
||||
- sig = sigwaitinfo(&sigmask, NULL);
|
||||
+ err = sigwait(&sigmask, &sig);
|
||||
|
||||
- if(sig == -1) {
|
||||
+ if(err == -1) {
|
||||
switch(errno) {
|
||||
- case EAGAIN:
|
||||
- /* interval timed out */
|
||||
- waiting = 0;
|
||||
- /* FALLTHROUGH */
|
||||
case EINTR:
|
||||
- /* if waiting, the wait will be longer, but
|
||||
- that's OK */
|
||||
continue;
|
||||
default:
|
||||
- BAD_ERROR("sigtimedwait/sigwaitinfo failed "
|
||||
+ BAD_ERROR("sigwait failed "
|
||||
"because %s\n", strerror(errno));
|
||||
}
|
||||
}
|
||||
@@ -179,8 +170,12 @@ void *info_thrd(void *arg)
|
||||
/* set one second interval period, if ^\ received
|
||||
within then, dump queue and cache status */
|
||||
waiting = 1;
|
||||
- } else
|
||||
+ alarm(1);
|
||||
+ } else if (sig == SIGQUIT) {
|
||||
dump_state();
|
||||
+ } else if (sig == SIGALRM) {
|
||||
+ waiting = 0;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue