[ https://issues.apache.org/jira/browse/THRIFT-2460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13968127#comment-13968127 ]
Jaesang Kim edited comment on THRIFT-2460 at 4/14/14 6:53 AM: -------------------------------------------------------------- this is a my patch to set unopened socket fd to negative integer. [~jensg] In daemon process, usually close STDIN(fd 0) and fd 0 reused anywhere in the process. So, have to use -1 for a invalid socket. e.g.) In thrift CPP library, used THRIFT_INVALID_SOCKET(-1) for a invalid one. was (Author: hsleep): this is a my patch to set unopened socket fd to negative integer. [~jensg] In daemon process, usually close STDIN(fd 0) and fd 0 reused anywhere in the process. So, have to use -1 for a invalid socket. e.g.) In thrift CPP library, use THRIFT_INVALID_SOCKET(-1). > unopened socket fd must be less than zero. > ------------------------------------------ > > Key: THRIFT-2460 > URL: https://issues.apache.org/jira/browse/THRIFT-2460 > Project: Thrift > Issue Type: Bug > Components: C glib - Library > Affects Versions: 0.9.1 > Reporter: Jaesang Kim > Attachments: thrift-2460-unopened_socket_set_to_negative_integer.patch > > > ThriftSocket->sd is 0 when initialized. > But socket() function return a fd number greater than *equal* 0. > So, ThriftSocket->sd must be less than 0 in initialize function. -- This message was sent by Atlassian JIRA (v6.2#6252)