mirror of
https://github.com/wassname/ray.git
synced 2026-09-09 11:32:43 +08:00
Replace direct calls to recv with read_bytes. (#78)
* Replace direct calls to recv with read_bytes. * Fixes. * Formatting.
This commit is contained in:
committed by
Philipp Moritz
parent
de2dd1f506
commit
61755bc168
+3
-1
@@ -6,6 +6,8 @@
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "io.h"
|
||||
|
||||
/* This is used to define the array of object IDs. */
|
||||
const UT_icd object_id_icd = {sizeof(object_id), NULL, NULL, NULL};
|
||||
|
||||
@@ -20,7 +22,7 @@ unique_id globally_unique_id(void) {
|
||||
LOG_ERROR("Could not generate random number");
|
||||
}
|
||||
unique_id result;
|
||||
read(fd, &result.id[0], UNIQUE_ID_SIZE);
|
||||
CHECK(read_bytes(fd, &result.id[0], UNIQUE_ID_SIZE) >= 0);
|
||||
close(fd);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user