mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-12-01 12:26:34 -05:00
Formatting: normalize brace style and parameter alignment
Some checks failed
mkdocs / deploy (push) Has been cancelled
Some checks failed
mkdocs / deploy (push) Has been cancelled
No functional change: libfuse/helper.cpp (fuse_daemonize, fuse_helper_opt_proc, fuse_parse_cmdline) and mergerfs fuse_init.cpp (_want helpers) reformatted to match the project's GNU-style brace placement and aligned parameter lists.
This commit is contained in:
parent
ec40866091
commit
da68cf3a85
2 changed files with 58 additions and 50 deletions
|
|
@ -153,17 +153,21 @@ fuse_parse_cmdline(struct fuse_args *args_,
|
||||||
|
|
||||||
err:
|
err:
|
||||||
free(hopts.mountpoint);
|
free(hopts.mountpoint);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int fuse_daemonize(int foreground)
|
int
|
||||||
|
fuse_daemonize(int foreground)
|
||||||
|
{
|
||||||
|
if(!foreground)
|
||||||
{
|
{
|
||||||
if (!foreground) {
|
|
||||||
int nullfd;
|
int nullfd;
|
||||||
int waiter[2];
|
int waiter[2];
|
||||||
char completed;
|
char completed;
|
||||||
|
|
||||||
if (pipe(waiter)) {
|
if(pipe(waiter))
|
||||||
|
{
|
||||||
perror("fuse_daemonize: pipe");
|
perror("fuse_daemonize: pipe");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
@ -172,7 +176,8 @@ int fuse_daemonize(int foreground)
|
||||||
* demonize current process by forking it and killing the
|
* demonize current process by forking it and killing the
|
||||||
* parent. This makes current process as a child of 'init'.
|
* parent. This makes current process as a child of 'init'.
|
||||||
*/
|
*/
|
||||||
switch(fork()) {
|
switch(fork())
|
||||||
|
{
|
||||||
case -1:
|
case -1:
|
||||||
perror("fuse_daemonize: fork");
|
perror("fuse_daemonize: fork");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -183,7 +188,8 @@ int fuse_daemonize(int foreground)
|
||||||
_exit(0);
|
_exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setsid() == -1) {
|
if(setsid() == -1)
|
||||||
|
{
|
||||||
perror("fuse_daemonize: setsid");
|
perror("fuse_daemonize: setsid");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
@ -191,7 +197,8 @@ int fuse_daemonize(int foreground)
|
||||||
(void) chdir("/");
|
(void) chdir("/");
|
||||||
|
|
||||||
nullfd = open("/dev/null", O_RDWR, 0);
|
nullfd = open("/dev/null", O_RDWR, 0);
|
||||||
if (nullfd != -1) {
|
if(nullfd != -1)
|
||||||
|
{
|
||||||
(void) dup2(nullfd, 0);
|
(void) dup2(nullfd, 0);
|
||||||
(void) dup2(nullfd, 1);
|
(void) dup2(nullfd, 1);
|
||||||
(void) dup2(nullfd, 2);
|
(void) dup2(nullfd, 2);
|
||||||
|
|
@ -205,6 +212,7 @@ int fuse_daemonize(int foreground)
|
||||||
close(waiter[0]);
|
close(waiter[0]);
|
||||||
close(waiter[1]);
|
close(waiter[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue