=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/openssl/apps.c,v retrieving revision 1.51 retrieving revision 1.52 diff -c -r1.51 -r1.52 *** src/usr.bin/openssl/apps.c 2019/02/09 15:49:21 1.51 --- src/usr.bin/openssl/apps.c 2019/06/28 13:35:02 1.52 *************** *** 1,4 **** ! /* $OpenBSD: apps.c,v 1.51 2019/02/09 15:49:21 inoguchi Exp $ */ /* * Copyright (c) 2014 Joel Sing * --- 1,4 ---- ! /* $OpenBSD: apps.c,v 1.52 2019/06/28 13:35:02 deraadt Exp $ */ /* * Copyright (c) 2014 Joel Sing * *************** *** 1377,1383 **** goto err; } ! if (rename(serialfile, opath) < 0 && errno != ENOENT && errno != ENOTDIR) { BIO_printf(bio_err, "unable to rename %s to %s\n", serialfile, opath); --- 1377,1383 ---- goto err; } ! if (rename(serialfile, opath) == -1 && errno != ENOENT && errno != ENOTDIR) { BIO_printf(bio_err, "unable to rename %s to %s\n", serialfile, opath); *************** *** 1386,1396 **** } ! if (rename(npath, serialfile) < 0) { BIO_printf(bio_err, "unable to rename %s to %s\n", npath, serialfile); perror("reason"); ! if (rename(opath, serialfile) < 0) { BIO_printf(bio_err, "unable to rename %s to %s\n", opath, serialfile); perror("reason"); --- 1386,1396 ---- } ! if (rename(npath, serialfile) == -1) { BIO_printf(bio_err, "unable to rename %s to %s\n", npath, serialfile); perror("reason"); ! if (rename(opath, serialfile) == -1) { BIO_printf(bio_err, "unable to rename %s to %s\n", opath, serialfile); perror("reason"); *************** *** 1599,1616 **** goto err; } ! if (rename(dbfile, odbpath) < 0 && errno != ENOENT && errno != ENOTDIR) { BIO_printf(bio_err, "unable to rename %s to %s\n", dbfile, odbpath); perror("reason"); goto err; } ! if (rename(dbpath, dbfile) < 0) { BIO_printf(bio_err, "unable to rename %s to %s\n", dbpath, dbfile); perror("reason"); ! if (rename(odbpath, dbfile) < 0) { BIO_printf(bio_err, "unable to rename %s to %s\n", odbpath, dbfile); perror("reason"); --- 1599,1616 ---- goto err; } ! if (rename(dbfile, odbpath) == -1 && errno != ENOENT && errno != ENOTDIR) { BIO_printf(bio_err, "unable to rename %s to %s\n", dbfile, odbpath); perror("reason"); goto err; } ! if (rename(dbpath, dbfile) == -1) { BIO_printf(bio_err, "unable to rename %s to %s\n", dbpath, dbfile); perror("reason"); ! if (rename(odbpath, dbfile) == -1) { BIO_printf(bio_err, "unable to rename %s to %s\n", odbpath, dbfile); perror("reason"); *************** *** 1618,1633 **** goto err; } ! if (rename(attrpath, oattrpath) < 0 && errno != ENOENT && errno != ENOTDIR) { BIO_printf(bio_err, "unable to rename %s to %s\n", attrpath, oattrpath); perror("reason"); ! if (rename(dbfile, dbpath) < 0) { BIO_printf(bio_err, "unable to rename %s to %s\n", dbfile, dbpath); perror("reason"); } ! if (rename(odbpath, dbfile) < 0) { BIO_printf(bio_err, "unable to rename %s to %s\n", odbpath, dbfile); perror("reason"); --- 1618,1633 ---- goto err; } ! if (rename(attrpath, oattrpath) == -1 && errno != ENOENT && errno != ENOTDIR) { BIO_printf(bio_err, "unable to rename %s to %s\n", attrpath, oattrpath); perror("reason"); ! if (rename(dbfile, dbpath) == -1) { BIO_printf(bio_err, "unable to rename %s to %s\n", dbfile, dbpath); perror("reason"); } ! if (rename(odbpath, dbfile) == -1) { BIO_printf(bio_err, "unable to rename %s to %s\n", odbpath, dbfile); perror("reason"); *************** *** 1635,1655 **** goto err; } ! if (rename(nattrpath, attrpath) < 0) { BIO_printf(bio_err, "unable to rename %s to %s\n", nattrpath, attrpath); perror("reason"); ! if (rename(oattrpath, attrpath) < 0) { BIO_printf(bio_err, "unable to rename %s to %s\n", oattrpath, attrpath); perror("reason"); } ! if (rename(dbfile, dbpath) < 0) { BIO_printf(bio_err, "unable to rename %s to %s\n", dbfile, dbpath); perror("reason"); } ! if (rename(odbpath, dbfile) < 0) { BIO_printf(bio_err, "unable to rename %s to %s\n", odbpath, dbfile); perror("reason"); --- 1635,1655 ---- goto err; } ! if (rename(nattrpath, attrpath) == -1) { BIO_printf(bio_err, "unable to rename %s to %s\n", nattrpath, attrpath); perror("reason"); ! if (rename(oattrpath, attrpath) == -1) { BIO_printf(bio_err, "unable to rename %s to %s\n", oattrpath, attrpath); perror("reason"); } ! if (rename(dbfile, dbpath) == -1) { BIO_printf(bio_err, "unable to rename %s to %s\n", dbfile, dbpath); perror("reason"); } ! if (rename(odbpath, dbfile) == -1) { BIO_printf(bio_err, "unable to rename %s to %s\n", odbpath, dbfile); perror("reason");