Re: [PATCH 7/6] run-command: block signals between fork and execve

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eric Wong <e@xxxxxxxxx> wrote:
> Brandon Williams <bmwill@xxxxxxxxxx> wrote:
> > On 04/13, Eric Wong wrote:
> > > @@ -277,6 +278,8 @@ static void child_err_spew(struct child_process *cmd, struct child_err *cerr)
> > >  		error_errno("exec '%s': cd to '%s' failed",
> > >  			    cmd->argv[0], cmd->dir);
> > >  		break;
> > > +	case CHILD_ERR_SIGPROCMASK:
> > > +		error_errno("sigprocmask failed restoring signals");
> > 
> > missing a break statement here I'll add it in, in the re-roll.
> 
> Good catch, thanks!

Actually, I now wonder if that should be die_errno instead.
sigprocmask failures (EFAULT/EINVAL) would only be due
to programmer error.

In one of my minor projects(*), I do something like this:

# define CHECK(type, expect, expr) do { \
	type checkvar = (expr); \
	assert(checkvar == (expect) && "BUG" && __FILE__ && __LINE__); \
	} while (0)

	CHECK(int, 0, sigfillset(&fullset));
	CHECK(int, 0, sigemptyset(&emptyset));
	CHECK(int, 0, pthread_sigmask(SIG_SETMASK, &fullset, NULL));

Dunno if it's considered good style or not, here.

(*) git clone git://bogomips.org/cmogstored



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]