Compare commits

..

No commits in common. "e2ff0ad27390a5b50af914080926304ef8e503cf" and "69f3e28f2c49664f9ad6f6c581ebb9c70e3838cf" have entirely different histories.

3 changed files with 4 additions and 6 deletions

View File

@ -56,7 +56,7 @@ extern "C"
#endif
/* Flush a stream's buffers. */
int fflush(FILE* stream);
int fflush(FILE*);
/* Open a file and bind a stream to it. */
FILE* fopen(const char* path, const char* mode);
@ -67,7 +67,7 @@ extern "C"
/* Change the underlying file and mode of a stream. */
FILE* freopen(const char* path, const char* mode, FILE* stream);
/* Close a file and free up its stream. */
/* Close a file and frees up its stream. */
int fclose(FILE* stream);
/* Return the file descriptor associated with a stream. */

View File

@ -16,7 +16,7 @@ extern "C"
{
struct spwd* result;
if (getspent_r(&spwd, s_buf, sizeof(s_buf), &result) < 0) return nullptr;
getspent_r(&spwd, s_buf, sizeof(s_buf), &result);
return result;
}
@ -28,7 +28,7 @@ extern "C"
if (!f)
{
f = fopen("/etc/shadow", "r");
if (!f) return -1;
if (!f) return 0;
fcntl(fileno(f), F_SETFD, FD_CLOEXEC);
}

View File

@ -793,13 +793,11 @@ extern "C"
{
close(pfds[0]);
dup2(pfds[1], STDOUT_FILENO);
close(pfds[1]);
}
else
{
close(pfds[1]);
dup2(pfds[0], STDIN_FILENO);
close(pfds[0]);
}
execl("/bin/sh", "sh", "-c", command, nullptr);