forked from Imagelibrary/rtems
cpukit/libcsupport/src/pwdgrp.c: Check return value
Coverity Id 1255518. mkdir() could fail. Check return value and return on failure. Behavior is similar to if open() failed while writing the files.
This commit is contained in:
@@ -61,7 +61,11 @@ static void init_file(const char *name, const char *content)
|
||||
*/
|
||||
static void pwdgrp_init(void)
|
||||
{
|
||||
mkdir("/etc", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
|
||||
int rc;
|
||||
|
||||
rc = mkdir("/etc", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
|
||||
if ( rc != 0 )
|
||||
return;
|
||||
|
||||
/*
|
||||
* Initialize /etc/passwd
|
||||
|
||||
Reference in New Issue
Block a user