X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdebug.c;h=0c6235ebc48977e55e5e6ff9315ca1faccb545b0;hb=b5ba959dcae956a8405a83e0c5ee0617947c922a;hp=3d1b1a4cee1f3430210a20a79524c196c3ac5fa8;hpb=5b36dc81adf01fc3caa1d60776b41707a4395e84;p=freeradius.git diff --git a/src/lib/debug.c b/src/lib/debug.c index 3d1b1a4..0c6235e 100644 --- a/src/lib/debug.c +++ b/src/lib/debug.c @@ -165,7 +165,7 @@ static int fr_debugger_attached(void) ret = 1; /* Something is already attached */ - if (write(from_child[1], &ret, 1) < 0) { + if (write(from_child[1], &ret, sizeof(ret)) < 0) { fprintf(stderr, "Writing ptrace status to parent failed: %s", fr_syserror(errno)); } @@ -180,7 +180,7 @@ static int fr_debugger_attached(void) * This read may be interrupted by pattach, * which is why we need the loop. */ - while ((read(from_child[0], &ret, 1) < 0) && (errno == EINTR)); + while ((read(from_child[0], &ret, sizeof(ret)) < 0) && (errno == EINTR)); /* Ret not updated */ if (ret < 0) {