From 9f3242dd71ec456360855e831acedb5c46dad7d1 Mon Sep 17 00:00:00 2001 From: 44670 <44670@users.noreply.github.com> Date: Fri, 23 May 2025 02:57:55 -0700 Subject: [PATCH] Replace assignment (=) with comparison (==) in write() check --- sgl-kernel/csrc/cpu/shm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sgl-kernel/csrc/cpu/shm.cpp b/sgl-kernel/csrc/cpu/shm.cpp index 9f7d89df14..3ce4520687 100644 --- a/sgl-kernel/csrc/cpu/shm.cpp +++ b/sgl-kernel/csrc/cpu/shm.cpp @@ -54,7 +54,7 @@ void shared_open(SharedData* data, const char* name, size_t nbytes) { void shared_create(SharedData* data, const char* name, void* bytes, size_t nbytes) { int d = shm_open(name, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR); if (d != -1) { - if (nbytes = write(d, bytes, nbytes)) { + if (nbytes == write(d, bytes, nbytes)) { shared_open(data, name, nbytes); } } else {