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