Locale: try detecting with locale command

in case $LC_* envs are not set ( macOS )
This commit is contained in:
李通洲
2022-09-21 16:03:51 +08:00
parent 65ed48a1bc
commit f9fa482b83
3 changed files with 38 additions and 4 deletions
+5 -3
View File
@@ -6,16 +6,16 @@
#include <unistd.h>
#include <sys/wait.h>
void ffProcessAppendStdOut(FFstrbuf* buffer, char* const argv[])
const char* ffProcessAppendStdOut(FFstrbuf* buffer, char* const argv[])
{
int pipes[2];
if(pipe(pipes) == -1)
return;
return "pipe() failed";
pid_t childPid = fork();
if(childPid == -1)
return;
return "fork() failed";
//Child
if(childPid == 0)
@@ -33,4 +33,6 @@ void ffProcessAppendStdOut(FFstrbuf* buffer, char* const argv[])
waitpid(childPid, NULL, 0);
ffAppendFDBuffer(pipes[0], buffer);
close(pipes[0]);
return NULL;
}
+1 -1
View File
@@ -5,6 +5,6 @@
#include "util/FFstrbuf.h"
void ffProcessAppendStdOut(FFstrbuf* buffer, char* const argv[]);
const char* ffProcessAppendStdOut(FFstrbuf* buffer, char* const argv[]);
#endif