1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-09-06 04:47:59 +00:00

Avoid double lock

This commit is contained in:
Carles Fernandez
2025-08-12 13:49:58 +02:00
parent 9d9a46abea
commit 406f70ed57

View File

@@ -626,7 +626,7 @@ int readfile(file_t *file, unsigned char *buff, int nmax, char *msg)
} }
} }
tracet(5, "readfile: fp=%p nr=%d fpos=%zu\n", file->fp, nr, file->fpos); tracet(5, "readfile: fp=%p \n nr=%d fpos=%u\n", file->fp, nr, file->fpos);
return nr; return nr;
} }
@@ -2271,7 +2271,6 @@ int stropen(stream_t *stream, int type, int mode, const char *path)
{ {
return 0; /* invalid arguments */ return 0; /* invalid arguments */
} }
strlock(stream);
stream->type = type; stream->type = type;
stream->mode = mode; stream->mode = mode;
std::strncpy(stream->path, path, MAXSTRPATH - 1); std::strncpy(stream->path, path, MAXSTRPATH - 1);
@@ -2312,7 +2311,6 @@ int stropen(stream_t *stream, int type, int mode, const char *path)
return 1; return 1;
} }
stream->state = (stream->port != nullptr) ? 1 : -1; stream->state = (stream->port != nullptr) ? 1 : -1;
strunlock(stream);
return (stream->port != nullptr) ? 1 : 0; return (stream->port != nullptr) ? 1 : 0;
} }