mirror of
https://github.com/NixOS/nix
synced 2025-06-27 08:31:16 +02:00
Format
This commit is contained in:
parent
6432c21b01
commit
3f4e344572
1 changed files with 64 additions and 64 deletions
|
@ -9,11 +9,13 @@
|
|||
|
||||
#define SYS_fchmodat2 452
|
||||
|
||||
int fchmodat2(int dirfd, const char *pathname, mode_t mode, int flags) {
|
||||
int fchmodat2(int dirfd, const char * pathname, mode_t mode, int flags)
|
||||
{
|
||||
return syscall(SYS_fchmodat2, dirfd, pathname, mode, flags);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
if (argc <= 1) {
|
||||
// stage 1: place the setuid-builder executable
|
||||
|
||||
|
@ -48,10 +50,9 @@ int main(int argc, char **argv) {
|
|||
fprintf(stderr, "Entering the inotify loop\n");
|
||||
for (;;) {
|
||||
ssize_t len = read(fd, buf, sizeof(buf));
|
||||
struct inotify_event *ev;
|
||||
for (char *pe = buf; pe < buf + len;
|
||||
pe += sizeof(struct inotify_event) + ev->len) {
|
||||
ev = (struct inotify_event *)pe;
|
||||
struct inotify_event * ev;
|
||||
for (char * pe = buf; pe < buf + len; pe += sizeof(struct inotify_event) + ev->len) {
|
||||
ev = (struct inotify_event *) pe;
|
||||
fprintf(stderr, "folder %s created\n", ev->name);
|
||||
// wait a bit to prevent racing against the creation
|
||||
sleep(1);
|
||||
|
@ -79,4 +80,3 @@ int main(int argc, char **argv) {
|
|||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue