Fix a few unused result warnings
This commit is contained in:
parent
9024b549a0
commit
6490654733
@ -96,12 +96,18 @@ void OpenURI(ByteString uri)
|
|||||||
char *cmd = (char*)malloc(7+uri.length());
|
char *cmd = (char*)malloc(7+uri.length());
|
||||||
strcpy(cmd, "open ");
|
strcpy(cmd, "open ");
|
||||||
strappend(cmd, (char*)uri.c_str());
|
strappend(cmd, (char*)uri.c_str());
|
||||||
system(cmd);
|
if (system(cmd))
|
||||||
|
{
|
||||||
|
fprintf(stderr, "system(cmd) return non-zero value\n");
|
||||||
|
}
|
||||||
#elif defined(LIN)
|
#elif defined(LIN)
|
||||||
char *cmd = (char*)malloc(11+uri.length());
|
char *cmd = (char*)malloc(11+uri.length());
|
||||||
strcpy(cmd, "xdg-open ");
|
strcpy(cmd, "xdg-open ");
|
||||||
strappend(cmd, (char*)uri.c_str());
|
strappend(cmd, (char*)uri.c_str());
|
||||||
system(cmd);
|
if (system(cmd))
|
||||||
|
{
|
||||||
|
fprintf(stderr, "system(cmd) return non-zero value\n");
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
printf("Cannot open browser\n");
|
printf("Cannot open browser\n");
|
||||||
#endif
|
#endif
|
||||||
|
@ -652,11 +652,17 @@ int main(int argc, char * argv[])
|
|||||||
std::map<ByteString, ByteString> arguments = readArguments(argc, argv);
|
std::map<ByteString, ByteString> arguments = readArguments(argc, argv);
|
||||||
|
|
||||||
if(arguments["ddir"].length())
|
if(arguments["ddir"].length())
|
||||||
|
{
|
||||||
#ifdef WIN
|
#ifdef WIN
|
||||||
_chdir(arguments["ddir"].c_str());
|
int failure = _chdir(arguments["ddir"].c_str());
|
||||||
#else
|
#else
|
||||||
chdir(arguments["ddir"].c_str());
|
int failure = chdir(arguments["ddir"].c_str());
|
||||||
#endif
|
#endif
|
||||||
|
if (failure)
|
||||||
|
{
|
||||||
|
perror("failed to chdir to requested ddir");
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef WIN
|
#ifdef WIN
|
||||||
@ -671,10 +677,14 @@ int main(int argc, char * argv[])
|
|||||||
if(ddir)
|
if(ddir)
|
||||||
{
|
{
|
||||||
#ifdef WIN
|
#ifdef WIN
|
||||||
_chdir(ddir);
|
int failure = _chdir(ddir);
|
||||||
#else
|
#else
|
||||||
chdir(ddir);
|
int failure = chdir(ddir);
|
||||||
#endif
|
#endif
|
||||||
|
if (failure)
|
||||||
|
{
|
||||||
|
perror("failed to chdir to default ddir");
|
||||||
|
}
|
||||||
SDL_free(ddir);
|
SDL_free(ddir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -695,8 +705,17 @@ int main(int argc, char * argv[])
|
|||||||
|
|
||||||
if(arguments["redirect"] == "true")
|
if(arguments["redirect"] == "true")
|
||||||
{
|
{
|
||||||
freopen("stdout.log", "w", stdout);
|
FILE *new_stdout = freopen("stdout.log", "w", stdout);
|
||||||
freopen("stderr.log", "w", stderr);
|
FILE *new_stderr = freopen("stderr.log", "w", stderr);
|
||||||
|
if (!new_stdout || !new_stderr)
|
||||||
|
{
|
||||||
|
// no point in printing an error to stdout/stderr since the user probably
|
||||||
|
// requests those streams be redirected because they can't see them
|
||||||
|
// otherwise. so just throw an exception instead anf hope that the OS
|
||||||
|
// and the standard library is smart enough to display the error message
|
||||||
|
// in some useful manner.
|
||||||
|
throw std::runtime_error("cannot honour request to redirect standard streams to log files");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(arguments["scale"].length())
|
if(arguments["scale"].length())
|
||||||
|
@ -301,7 +301,10 @@ OptionsView::OptionsView():
|
|||||||
#endif
|
#endif
|
||||||
char* workingDirectory = new char[FILENAME_MAX+strlen(openCommand)];
|
char* workingDirectory = new char[FILENAME_MAX+strlen(openCommand)];
|
||||||
sprintf(workingDirectory, "%s\"%s\"", openCommand, getcwd(NULL, 0));
|
sprintf(workingDirectory, "%s\"%s\"", openCommand, getcwd(NULL, 0));
|
||||||
system(workingDirectory);
|
if (system(workingDirectory))
|
||||||
|
{
|
||||||
|
fprintf(stderr, "system(cmd) return non-zero value\n");
|
||||||
|
}
|
||||||
delete[] workingDirectory;
|
delete[] workingDirectory;
|
||||||
} });
|
} });
|
||||||
scrollPanel->AddChild(dataFolderButton);
|
scrollPanel->AddChild(dataFolderButton);
|
||||||
|
Loading…
Reference in New Issue
Block a user