tree-wide: Add+run spatch to use glnx_throw()
I had to run a sed job to add whitespace after, but otherwise this was easy. Closes: #890 Approved by: jlebon
This commit is contained in:
1 parent
9bf8a8503a
commit
88a1fc92a9
11 files changed
+40
-43
No files matched your search
@@ -40,9 +40,7 @@ ot_parse_boolean (const char *value,
|
||||
*out_parsed = FALSE;
|
||||
else
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
"Invalid boolean argument '%s'", value);
|
||||
return FALSE;
|
||||
return glnx_throw (error, "Invalid boolean argument '%s'", value);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -57,9 +55,7 @@ ot_parse_keyvalue (const char *keyvalue,
|
||||
const char *eq = strchr (keyvalue, '=');
|
||||
if (!eq)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
"Missing '=' in KEY=VALUE for --set");
|
||||
return FALSE;
|
||||
return glnx_throw (error, "Missing '=' in KEY=VALUE for --set");
|
||||
}
|
||||
*out_key = g_strndup (keyvalue, eq - keyvalue);
|
||||
*out_value = g_strdup (eq + 1);
|
||||
|
||||
@@ -41,21 +41,15 @@ ot_util_filename_validate (const char *name,
|
||||
{
|
||||
if (strcmp (name, ".") == 0)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
"Invalid self-referential filename '.'");
|
||||
return FALSE;
|
||||
return glnx_throw (error, "Invalid self-referential filename '.'");
|
||||
}
|
||||
if (strcmp (name, "..") == 0)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
"Invalid path uplink filename '..'");
|
||||
return FALSE;
|
||||
return glnx_throw (error, "Invalid path uplink filename '..'");
|
||||
}
|
||||
if (strchr (name, '/') != NULL)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
"Invalid / in filename %s", name);
|
||||
return FALSE;
|
||||
return glnx_throw (error, "Invalid / in filename %s", name);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user