Fix build warnings: ignoring return value of ‘chdir’,

declared with attribute warn_unused_result
master-1.22
Pablo Barciela 2017-12-28 01:48:44 +01:00 committed by raveit65
parent 294ce367b2
commit e370b85599
2 changed files with 4 additions and 2 deletions

View File

@ -230,7 +230,8 @@ cwd_of_pid (int pid)
if (chdir (cwd_file) == 0)
{
working_dir = g_get_current_dir ();
(void) chdir (cwd);
if (chdir (cwd) < 0)
g_warning ("Could not change working directory.");
}
g_free (cwd);
}

View File

@ -563,7 +563,8 @@ main (int argc, char **argv)
*/
home_dir = g_get_home_dir ();
if (home_dir == NULL || chdir (home_dir) < 0)
(void) chdir ("/");
if (chdir ("/") < 0)
g_warning ("Could not change working directory.");
options = terminal_options_parse (working_directory,
NULL,