Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: fusl/src/process/posix_spawn_file_actions_addopen.c

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #include <spawn.h> 1 #include <spawn.h>
2 #include <stdlib.h> 2 #include <stdlib.h>
3 #include <string.h> 3 #include <string.h>
4 #include <errno.h> 4 #include <errno.h>
5 #include "fdop.h" 5 #include "fdop.h"
6 6
7 int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t *restrict fa, in t fd, const char *restrict path, int flags, mode_t mode) 7 int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t* restrict fa,
8 { 8 int fd,
9 » struct fdop *op = malloc(sizeof *op + strlen(path) + 1); 9 const char* restrict path,
10 » if (!op) return ENOMEM; 10 int flags,
11 » op->cmd = FDOP_OPEN; 11 mode_t mode) {
12 » op->fd = fd; 12 struct fdop* op = malloc(sizeof *op + strlen(path) + 1);
13 » op->oflag = flags; 13 if (!op)
14 » op->mode = mode; 14 return ENOMEM;
15 » strcpy(op->path, path); 15 op->cmd = FDOP_OPEN;
16 » if ((op->next = fa->__actions)) op->next->prev = op; 16 op->fd = fd;
17 » op->prev = 0; 17 op->oflag = flags;
18 » fa->__actions = op; 18 op->mode = mode;
19 » return 0; 19 strcpy(op->path, path);
20 if ((op->next = fa->__actions))
21 op->next->prev = op;
22 op->prev = 0;
23 fa->__actions = op;
24 return 0;
20 } 25 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698