Signed-off-by: Nikos Ntarmos <ntarmos@cs.uoi.gr>
Signed-off-by: Pavel Labath <pavelo@centrum.sk>
dup(childend); //by dupping childend, the returned fd will have close-on-exec turned off
execl("/bin/sh", "sh", "-c", command, (char *) NULL);
_exit(EXIT_FAILURE); //child should die here, (normally execl will take care of this but it can fail)
dup(childend); //by dupping childend, the returned fd will have close-on-exec turned off
execl("/bin/sh", "sh", "-c", command, (char *) NULL);
_exit(EXIT_FAILURE); //child should die here, (normally execl will take care of this but it can fail)
int length;
length = fread(buf, 1, size, fp);
int length;
length = fread(buf, 1, size, fp);
buf[length] = '\0';
if (length > 0 && buf[length - 1] == '\n') {
buf[length - 1] = '\0';
buf[length] = '\0';
if (length > 0 && buf[length - 1] == '\n') {
buf[length - 1] = '\0';
ed->buffer = malloc(text_buffer_size);
length = fread(ed->buffer, 1, text_buffer_size, fp);
ed->buffer = malloc(text_buffer_size);
length = fread(ed->buffer, 1, text_buffer_size, fp);
output = ed->buffer;
output[length] = '\0';
output = ed->buffer;
output[length] = '\0';