projects
/
services
/
createrepo_c.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c8b4aef
)
createrepo_c: Add temporary blocking of SIGINT to prevent race condition.
author
Tomas Mlcoch
<tmlcoch@redhat.com>
Wed, 29 May 2013 13:15:14 +0000
(15:15 +0200)
committer
Tomas Mlcoch
<tmlcoch@redhat.com>
Wed, 29 May 2013 13:15:14 +0000
(15:15 +0200)
src/createrepo_c.c
patch
|
blob
|
history
diff --git
a/src/createrepo_c.c
b/src/createrepo_c.c
index
d79e7bb
..
e7f7c01
100644
(file)
--- a/
src/createrepo_c.c
+++ b/
src/createrepo_c.c
@@
-640,6
+640,12
@@
main(int argc, char **argv)
tmp_out_repo = g_strconcat(out_dir, ".repodata/", NULL);
}
+ // Block SIGINT
+
+ sigset_t intmask;
+ sigemptyset(&intmask);
+ sigaddset(&intmask, SIGINT);
+ sigprocmask(SIG_BLOCK, &intmask, NULL);
// Check if tmp_out_repo exists & Create tmp_out_repo dir
@@
-670,6
+676,12
@@
main(int argc, char **argv)
exit(1);
}
+ // Unblock SIGINT
+
+ sigemptyset(&intmask);
+ sigaddset(&intmask, SIGINT);
+ sigprocmask(SIG_UNBLOCK, &intmask, NULL);
+
// Open package list