13
0

fix ssize_t/size_t confusion

This commit is contained in:
Paul Davis 2013-06-07 11:59:47 -04:00
parent 8d6dd9ecc0
commit 323f39d8b6

View File

@ -415,6 +415,7 @@ SystemExec::terminate ()
{ {
::pthread_mutex_lock(&write_lock); ::pthread_mutex_lock(&write_lock);
close_stdin(); close_stdin();
if (pid) { if (pid) {
::usleep(50000); ::usleep(50000);
sched_yield(); sched_yield();
@ -643,7 +644,8 @@ int
SystemExec::write_to_stdin(std::string d, size_t len) SystemExec::write_to_stdin(std::string d, size_t len)
{ {
const char *data; const char *data;
size_t r,c; ssize_t r;
size_t c;
::pthread_mutex_lock(&write_lock); ::pthread_mutex_lock(&write_lock);
data=d.c_str(); data=d.c_str();
@ -658,7 +660,7 @@ SystemExec::write_to_stdin(std::string d, size_t len)
sleep(1); sleep(1);
continue; continue;
} }
if (r != (len-c)) { if ((size_t) r != (len-c)) {
::pthread_mutex_unlock(&write_lock); ::pthread_mutex_unlock(&write_lock);
return c; return c;
} }