Fix some ignored return values.
authorCarl Hetherington <cth@carlh.net>
Sun, 26 Jul 2020 20:47:51 +0000 (22:47 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 26 Jul 2020 20:47:51 +0000 (22:47 +0200)
src/lib/cross_linux.cc

index 25fd3490e2bf40374995a5169edebd054afc3607..28b8a4b416d343824fddf94a28505d760d38e6d8 100644 (file)
@@ -113,7 +113,10 @@ run_ffprobe (boost::filesystem::path content, boost::filesystem::path out)
 {
        string ffprobe = "ffprobe \"" + content.string() + "\" 2> \"" + out.string() + "\"";
        LOG_GENERAL (N_("Probing with %1"), ffprobe);
-        system (ffprobe.c_str ());
+       int const r = system (ffprobe.c_str());
+       if (r == -1 || (WIFEXITED(r) && WEXITSTATUS(r) != 0)) {
+               LOG_GENERAL (N_("Could not run ffprobe (system returned %1"), r);
+       }
 }
 
 list<pair<string, string> >
@@ -378,7 +381,10 @@ unprivileged ()
                cerr << "getresuid() failed.\n";
                exit (EXIT_FAILURE);
        }
-       seteuid (ruid);
+       if (seteuid(ruid) == -1) {
+               cerr << "seteuid() failed.\n";
+               exit (EXIT_FAILURE);
+       }
 }
 
 PrivilegeEscalator::~PrivilegeEscalator ()