trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sureshsubbiah <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #653: [TRAFODION-2104]odb crashed when extr...
Date Thu, 11 Aug 2016 13:24:42 GMT
Github user sureshsubbiah commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/653#discussion_r74420605
  
    --- Diff: core/conn/odb/src/odb.c ---
    @@ -9889,7 +9889,9 @@ static void Oextract(int eid)
                 if ( etab[eid].fho ) {
                     (*hdfswrite)(hfs, etab[eid].fho, (void *)xbuff, xbuffl);
                 } else {
    -                (void)fwrite ( xbuff, 1, xbuffl, etab[eid].fo );
    +                if ( etab[eid].fo == stdout ) {
    --- End diff --
    
    If the current problem is that  etab[eid].fo was NULL and we tried to write to it, will
it not be better if the change was 
    if ( etab[eid].fo ) {
    fwrite (...)
    }
    This way we can handle cases where etab[eid].fo is a generic file handle too.
    Maybe the concern is on Line 9882 we have already called fclose on this file handle  
(if its not stdout) ?
    This change is safe. You could think about whether it could be made more general. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message