Source-Changes-HG archive

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

[src/trunk]: src/regress/lib/libposix Rename prn.c to prename.c to avoid prob...



details:   https://anonhg.NetBSD.org/src/rev/cbeb433360fb
branches:  trunk
changeset: 516246:cbeb433360fb
user:      tv <tv%NetBSD.org@localhost>
date:      Fri Oct 19 03:10:15 2001 +0000

description:
Rename prn.c to prename.c to avoid problems with certain Microsoft host OS's.

diffstat:

 regress/lib/libposix/nrn/Makefile  |   6 +-
 regress/lib/libposix/prename.c     |  72 ++++++++++++++++++++++++++++++++++++++
 regress/lib/libposix/prn.c         |  72 --------------------------------------
 regress/lib/libposix/prn1/Makefile |   6 +-
 regress/lib/libposix/prn2/Makefile |   6 +-
 5 files changed, 81 insertions(+), 81 deletions(-)

diffs (212 lines):

diff -r 7659bac8bfdd -r cbeb433360fb regress/lib/libposix/nrn/Makefile
--- a/regress/lib/libposix/nrn/Makefile Fri Oct 19 03:06:09 2001 +0000
+++ b/regress/lib/libposix/nrn/Makefile Fri Oct 19 03:10:15 2001 +0000
@@ -1,6 +1,6 @@
-#      $NetBSD: Makefile,v 1.1 1999/02/21 00:20:11 mjl Exp $
+#      $NetBSD: Makefile,v 1.2 2001/10/19 03:10:15 tv Exp $
 
-PROG=   prn
+PROG=   prename
 NOMAN=  t
 CLEANFILES+= t1 t2
 
@@ -10,6 +10,6 @@
 
 regress:
        @echo Testing BSD rename
-       ./prn
+       ./prename
 
 .include <bsd.prog.mk>
diff -r 7659bac8bfdd -r cbeb433360fb regress/lib/libposix/prename.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/regress/lib/libposix/prename.c    Fri Oct 19 03:10:15 2001 +0000
@@ -0,0 +1,72 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+int main(void)
+{
+       int errors = 0;
+       struct stat sb;
+
+       (void)unlink("t1");
+       (void)unlink("t2");
+       if (creat("t1", 0600) < 0) {
+               perror("create t1");
+               exit(1);
+       }
+
+       if (link("t1", "t2")) {
+               perror("link t1 t2");
+               exit(1);
+       }
+
+       /* Check if rename to same name works as expected */
+       if (rename("t1", "t1")) {
+               perror("rename t1 t1");
+               errors++;
+       }
+       if (stat("t1", &sb)) {
+               perror("rename removed file? stat t1");
+               exit(1);
+       }
+
+       if (rename("t1", "t2")) {
+               perror("rename t1 t2");
+               errors++;
+       }
+#if BSD_RENAME
+       /* check if rename of hardlinked file works the BSD way */
+       if (stat("t1", &sb)) {
+               if (errno != ENOENT) {
+                       perror("BSD rename should remove file! stat t1");
+                       errors++;
+               }
+       } else {
+               fprintf(stderr, "BSD rename should remove file!");
+               errors++;
+       }
+#else
+       /* check if rename of hardlinked file works as the standard says */
+       if (stat("t1", &sb)) {
+               perror("Posix rename should not remove file! stat t1");
+               errors++;
+       }
+#endif
+
+       /* check if we get the expected error */
+       /* this also exercises icky shared libraries goo */
+       if (rename("no/such/file/or/dir", "no/such/file/or/dir")) {
+               if (errno != ENOENT) {
+                       perror("rename no/such/file/or/dir");
+                       errors++;
+               }
+       } else {
+               fprintf(stderr, "No error renaming no/such/file/or/dir\n");
+               errors++;
+       }
+       
+       exit(errors ? 1 : 0);
+}
diff -r 7659bac8bfdd -r cbeb433360fb regress/lib/libposix/prn.c
--- a/regress/lib/libposix/prn.c        Fri Oct 19 03:06:09 2001 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-int main(void)
-{
-       int errors = 0;
-       struct stat sb;
-
-       (void)unlink("t1");
-       (void)unlink("t2");
-       if (creat("t1", 0600) < 0) {
-               perror("create t1");
-               exit(1);
-       }
-
-       if (link("t1", "t2")) {
-               perror("link t1 t2");
-               exit(1);
-       }
-
-       /* Check if rename to same name works as expected */
-       if (rename("t1", "t1")) {
-               perror("rename t1 t1");
-               errors++;
-       }
-       if (stat("t1", &sb)) {
-               perror("rename removed file? stat t1");
-               exit(1);
-       }
-
-       if (rename("t1", "t2")) {
-               perror("rename t1 t2");
-               errors++;
-       }
-#if BSD_RENAME
-       /* check if rename of hardlinked file works the BSD way */
-       if (stat("t1", &sb)) {
-               if (errno != ENOENT) {
-                       perror("BSD rename should remove file! stat t1");
-                       errors++;
-               }
-       } else {
-               fprintf(stderr, "BSD rename should remove file!");
-               errors++;
-       }
-#else
-       /* check if rename of hardlinked file works as the standard says */
-       if (stat("t1", &sb)) {
-               perror("Posix rename should not remove file! stat t1");
-               errors++;
-       }
-#endif
-
-       /* check if we get the expected error */
-       /* this also exercises icky shared libraries goo */
-       if (rename("no/such/file/or/dir", "no/such/file/or/dir")) {
-               if (errno != ENOENT) {
-                       perror("rename no/such/file/or/dir");
-                       errors++;
-               }
-       } else {
-               fprintf(stderr, "No error renaming no/such/file/or/dir\n");
-               errors++;
-       }
-       
-       exit(errors ? 1 : 0);
-}
diff -r 7659bac8bfdd -r cbeb433360fb regress/lib/libposix/prn1/Makefile
--- a/regress/lib/libposix/prn1/Makefile        Fri Oct 19 03:06:09 2001 +0000
+++ b/regress/lib/libposix/prn1/Makefile        Fri Oct 19 03:10:15 2001 +0000
@@ -1,6 +1,6 @@
-#      $NetBSD: Makefile,v 1.1 1999/02/21 00:20:11 mjl Exp $
+#      $NetBSD: Makefile,v 1.2 2001/10/19 03:10:15 tv Exp $
 
-PROG=   prn
+PROG=   prename
 NOMAN=  t
 CLEANFILES+= t1 t2
 
@@ -11,6 +11,6 @@
 
 regress:
        @echo Testing posix rename with -lposix
-       ./prn
+       ./prename
 
 .include <bsd.prog.mk>
diff -r 7659bac8bfdd -r cbeb433360fb regress/lib/libposix/prn2/Makefile
--- a/regress/lib/libposix/prn2/Makefile        Fri Oct 19 03:06:09 2001 +0000
+++ b/regress/lib/libposix/prn2/Makefile        Fri Oct 19 03:10:15 2001 +0000
@@ -1,6 +1,6 @@
-#      $NetBSD: Makefile,v 1.1 1999/02/21 00:20:11 mjl Exp $
+#      $NetBSD: Makefile,v 1.2 2001/10/19 03:10:16 tv Exp $
 
-PROG=   prn
+PROG=   prename
 NOMAN=  t
 CLEANFILES+= t1 t2
 
@@ -10,6 +10,6 @@
 
 regress:
        @echo Testing posix rename with -D_POSIX_SOURCE
-       ./prn
+       ./prename
 
 .include <bsd.prog.mk>



Home | Main Index | Thread Index | Old Index