X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fprocess.c;h=795a136d7de06453aafb77f7ab090b3a6f481f6b;hb=780325b5b8d4c0552b4b7719e0a38200d99f6b08;hp=3fc2e1827f7ebbba8f53f5882dafa38be751b561;hpb=cb22974d773942d66da42b700b8bca0db27a0920;p=sliver-openvswitch.git diff --git a/lib/process.c b/lib/process.c index 3fc2e1827..795a136d7 100644 --- a/lib/process.c +++ b/lib/process.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -408,14 +408,20 @@ struct stream { static int stream_open(struct stream *s, size_t max_size) { + int error; + s->max_size = max_size; ds_init(&s->log); if (pipe(s->fds)) { VLOG_WARN("failed to create pipe: %s", strerror(errno)); return errno; } - set_nonblocking(s->fds[0]); - return 0; + error = set_nonblocking(s->fds[0]); + if (error) { + close(s->fds[0]); + close(s->fds[1]); + } + return error; } static void