Commit: 678bf46b845c9749f0163c0374815b71b6c758e9
Parent: c115b11b14c62c1fc295baa43213c6bf8e892581
Author: Randy Palamar
Date: Tue, 25 Feb 2025 10:00:45 -0700
lib: fix bogus validity checks in send_data
Diffstat:
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/helpers/ogl_beamformer_lib.c b/helpers/ogl_beamformer_lib.c
@@ -301,15 +301,14 @@ set_beamformer_pipeline(char *shm_name, i32 *stages, i32 stages_count)
b32
send_data(char *pipe_name, char *shm_name, i16 *data, uv2 data_dim)
{
- b32 result = 0;
-
- if (g_pipe.file == INVALID_FILE) {
+ b32 result = g_pipe.file != INVALID_FILE;
+ if (!result) {
g_pipe = os_open_named_pipe(pipe_name);
result = g_pipe.file != INVALID_FILE;
if (!result)
error_msg("failed to open pipe");
}
- result &= !check_shared_memory(shm_name);
+ result &= check_shared_memory(shm_name);
if (result) {
g_bp->raw.rf_raw_dim = data_dim;