Replace empty ternary with helper method

This commit is contained in:
Daniel Lockyer
2017-11-24 09:31:08 +00:00
parent 71050acb68
commit 87e4e28dcf
4 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -368,7 +368,7 @@ static int tmpfs_patch_options(
assert(uid_shift != UID_INVALID);
if (asprintf(&buf, "%s%suid=" UID_FMT ",gid=" UID_FMT,
options ?: "", options ? "," : "",
strempty(options), options ? "," : "",
uid_shift, uid_shift) < 0)
return -ENOMEM;
@@ -379,7 +379,7 @@ static int tmpfs_patch_options(
if (selinux_apifs_context) {
char *t;
t = strjoin(options ?: "", options ? "," : "",
t = strjoin(strempty(options), options ? "," : "",
"context=\"", selinux_apifs_context, "\"");
free(buf);
if (!t)