mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-28 07:30:33 +00:00
Further cleanup-code/less "optimistic" assumptions. (#12298)
This commit is contained in:
parent
356ff9a7ff
commit
c504572cfa
@ -219,8 +219,18 @@ R_API R2Pipe *r2p_open(const char *cmd) {
|
||||
w32_createPipe (r2p, cmd);
|
||||
r2p->child = (int)(r2p->pipe);
|
||||
#else
|
||||
pipe (r2p->input);
|
||||
pipe (r2p->output);
|
||||
int r = pipe (r2p->input);
|
||||
if (r != 0) {
|
||||
eprintf ("pipe failed on input\n");
|
||||
r2p_close (r2p);
|
||||
return NULL;
|
||||
}
|
||||
r = pipe (r2p->output);
|
||||
if (r != 0) {
|
||||
eprintf ("pipe failed on output\n");
|
||||
r2p_close (r2p);
|
||||
return NULL;
|
||||
}
|
||||
#if LIBC_HAVE_FORK
|
||||
r2p->child = fork ();
|
||||
#else
|
||||
|
@ -61,10 +61,15 @@ R_API bool r_file_truncate (const char *filename, ut64 newsize) {
|
||||
return false;
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
_chsize (fd, newsize);
|
||||
int r = _chsize (fd, newsize);
|
||||
#else
|
||||
ftruncate (fd, newsize);
|
||||
int r = ftruncate (fd, newsize);
|
||||
#endif
|
||||
if (r != 0) {
|
||||
eprintf ("Coult not resize %s file\n", filename);
|
||||
close (fd);
|
||||
return false;
|
||||
}
|
||||
close (fd);
|
||||
return true;
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ R_API void r_rbtree_aug_insert(RBNode **root, void *data, RBNode *node, RBCompar
|
||||
return;
|
||||
}
|
||||
RBNode *t = NULL, *g = NULL, *p = NULL, *q = *root;
|
||||
int d, dep = 0;
|
||||
int d = 0, dep = 0;
|
||||
bool done = false;
|
||||
RBNode *path[R_RBTREE_MAX_HEIGHT];
|
||||
for (;;) {
|
||||
|
Loading…
Reference in New Issue
Block a user