Merge "LOC_API: Add group permissions after creating the pipe."
This commit is contained in:
commit
acc44b1af1
1 changed files with 9 additions and 1 deletions
10
loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c
Normal file → Executable file
10
loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c
Normal file → Executable file
|
@ -64,13 +64,21 @@ int loc_eng_dmn_conn_glue_pipeget(const char * pipe_name, int mode)
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
LOC_LOGD("%s, mode = %d\n", pipe_name, mode);
|
LOC_LOGD("%s, mode = %d\n", pipe_name, mode);
|
||||||
result = mkfifo(pipe_name, 0666);
|
result = mkfifo(pipe_name, 0660);
|
||||||
|
|
||||||
if ((result == -1) && (errno != EEXIST)) {
|
if ((result == -1) && (errno != EEXIST)) {
|
||||||
LOC_LOGE("failed: %s\n", strerror(errno));
|
LOC_LOGE("failed: %s\n", strerror(errno));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The mode in mkfifo is not honoured and does not provide the
|
||||||
|
// group permissions. Doing chmod to add group permissions.
|
||||||
|
result = chmod (pipe_name, 0660);
|
||||||
|
if (result != 0){
|
||||||
|
LOC_LOGE ("%s failed to change mode for %s, error = %s\n", __func__,
|
||||||
|
pipe_name, strerror(errno));
|
||||||
|
}
|
||||||
|
|
||||||
fd = open(pipe_name, mode);
|
fd = open(pipe_name, mode);
|
||||||
if (fd <= 0)
|
if (fd <= 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue