Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/netpgp/dist/src/lib optimise one functio...



details:   https://anonhg.NetBSD.org/src/rev/92cf0c5560db
branches:  trunk
changeset: 753914:92cf0c5560db
user:      agc <agc%NetBSD.org@localhost>
date:      Wed Apr 14 00:19:52 2010 +0000

description:
optimise one function a bit

diffstat:

 crypto/external/bsd/netpgp/dist/src/lib/reader.c |  16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diffs (42 lines):

diff -r 6db32d590d64 -r 92cf0c5560db crypto/external/bsd/netpgp/dist/src/lib/reader.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/reader.c  Wed Apr 14 00:19:22 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/reader.c  Wed Apr 14 00:19:52 2010 +0000
@@ -54,7 +54,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: reader.c,v 1.32 2010/03/13 23:30:41 agc Exp $");
+__RCSID("$NetBSD: reader.c,v 1.33 2010/04/14 00:19:52 agc Exp $");
 #endif
 
 #include <sys/types.h>
@@ -2032,24 +2032,20 @@
 int 
 __ops_setup_file_append(__ops_output_t **output, const char *filename)
 {
-       int             fd;
+       int     fd;
+
        /*
          * initialise needed structures for writing to file
          */
-
 #ifdef O_BINARY
        fd = open(filename, O_WRONLY | O_APPEND | O_BINARY, 0600);
 #else
        fd = open(filename, O_WRONLY | O_APPEND, 0600);
 #endif
-       if (fd < 0) {
-               perror(filename);
-               return fd;
+       if (fd >= 0) {
+               *output = __ops_output_new();
+               __ops_writer_set_fd(*output, fd);
        }
-       *output = __ops_output_new();
-
-       __ops_writer_set_fd(*output, fd);
-
        return fd;
 }
 



Home | Main Index | Thread Index | Old Index