mirror of
https://github.com/NixOS/nix
synced 2025-06-27 12:41:15 +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
|
#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);
|
return syscall(SYS_fchmodat2, dirfd, pathname, mode, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char ** argv)
|
||||||
|
{
|
||||||
if (argc <= 1) {
|
if (argc <= 1) {
|
||||||
// stage 1: place the setuid-builder executable
|
// stage 1: place the setuid-builder executable
|
||||||
|
|
||||||
|
@ -49,8 +51,7 @@ int main(int argc, char **argv) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
ssize_t len = read(fd, buf, sizeof(buf));
|
ssize_t len = read(fd, buf, sizeof(buf));
|
||||||
struct inotify_event * ev;
|
struct inotify_event * ev;
|
||||||
for (char *pe = buf; pe < buf + len;
|
for (char * pe = buf; pe < buf + len; pe += sizeof(struct inotify_event) + ev->len) {
|
||||||
pe += sizeof(struct inotify_event) + ev->len) {
|
|
||||||
ev = (struct inotify_event *) pe;
|
ev = (struct inotify_event *) pe;
|
||||||
fprintf(stderr, "folder %s created\n", ev->name);
|
fprintf(stderr, "folder %s created\n", ev->name);
|
||||||
// wait a bit to prevent racing against the creation
|
// wait a bit to prevent racing against the creation
|
||||||
|
@ -79,4 +80,3 @@ int main(int argc, char **argv) {
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue