Author: ngie
Date: Thu Mar 30 07:13:47 2017
New Revision: 316260
URL: https://svnweb.freebsd.org/changeset/base/316260

Log:
  Annotate all changes made in r316178-r316180 with __FreeBSD__
  
  Restore the stock (upstream) code under an #else block, so it's easier
  for me to visualize and understand the code that needs to be upstreamed.
  
  MFC after:    2 months
  X-MFC with:   r316178, r316179, r316180
  Sponsored by: Dell EMC Isilon

Modified:
  head/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c
  head/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c

Modified: head/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c   Thu Mar 30 06:55:43 
2017        (r316259)
+++ head/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c   Thu Mar 30 07:13:47 
2017        (r316260)
@@ -203,7 +203,11 @@ ATF_TC_BODY(msgctl_pid, tc)
 
        if (pid == 0) {
 
+#ifdef __FreeBSD__
                (void)msgsnd(id, &msg, sizeof(msg.buf), IPC_NOWAIT);
+#else
+               (void)msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT);
+#endif
 
                _exit(EXIT_SUCCESS);
        }
@@ -314,7 +318,11 @@ ATF_TC_BODY(msgctl_time, tc)
        t = time(NULL);
 
        (void)memset(&msgds, 0, sizeof(struct msqid_ds));
+#ifdef __FreeBSD__
        (void)msgsnd(id, &msg, sizeof(msg.buf), IPC_NOWAIT);
+#else
+       (void)msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT);
+#endif
        (void)msgctl(id, IPC_STAT, &msgds);
 
        if (llabs(t - msgds.msg_stime) > 1)

Modified: head/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c   Thu Mar 30 06:55:43 
2017        (r316259)
+++ head/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c   Thu Mar 30 07:13:47 
2017        (r316260)
@@ -98,7 +98,11 @@ ATF_TC_BODY(msgsnd_block, tc)
                 */
                for (;;) {
 
+#ifdef __FreeBSD__
                        if (msgsnd(id, &msg, sizeof(msg.buf), 0) < 0)
+#else
+                       if (msgsnd(id, &msg, sizeof(struct msg), 0) < 0)
+#endif
                                _exit(EXIT_FAILURE);
                }
        }
@@ -140,7 +144,11 @@ ATF_TC_BODY(msgsnd_count, tc)
        for (;;) {
 
                errno = 0;
+#ifdef __FreeBSD__
                rv = msgsnd(id, &msg, sizeof(msg.buf), IPC_NOWAIT);
+#else
+               rv = msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT);
+#endif
 
                if (rv == 0) {
                        i++;
@@ -184,12 +192,20 @@ ATF_TC_BODY(msgsnd_err, tc)
        errno = 0;
 
        ATF_REQUIRE_ERRNO(EFAULT, msgsnd(id, (void *)-1,
+#ifdef __FreeBSD__
                sizeof(msg.buf), IPC_NOWAIT) == -1);
+#else
+               sizeof(struct msg), IPC_NOWAIT) == -1);
+#endif
 
        errno = 0;
 
        ATF_REQUIRE_ERRNO(EINVAL, msgsnd(-1, &msg,
+#ifdef __FreeBSD__
                sizeof(msg.buf), IPC_NOWAIT) == -1);
+#else
+               sizeof(struct msg), IPC_NOWAIT) == -1);
+#endif
 
        errno = 0;
 
@@ -200,7 +216,11 @@ ATF_TC_BODY(msgsnd_err, tc)
        msg.mtype = 0;
 
        ATF_REQUIRE_ERRNO(EINVAL, msgsnd(id, &msg,
+#ifdef __FreeBSD__
                sizeof(msg.buf), IPC_NOWAIT) == -1);
+#else
+               sizeof(struct msg), IPC_NOWAIT) == -1);
+#endif
 
        ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);
 }
@@ -234,7 +254,11 @@ ATF_TC_BODY(msgsnd_nonblock, tc)
                for (;;) {
 
                        errno = 0;
+#ifdef __FreeBSD__
                        rv = msgsnd(id, &msg, sizeof(msg.buf), IPC_NOWAIT);
+#else
+                       rv = msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT);
+#endif
 
                        if (rv == -1 && errno == EAGAIN)
                                _exit(EXIT_SUCCESS);
@@ -299,7 +323,11 @@ ATF_TC_BODY(msgsnd_perm, tc)
 
                errno = 0;
 
+#ifdef __FreeBSD__
                if (msgsnd(id, &msg, sizeof(msg.buf), IPC_NOWAIT) == 0)
+#else
+               if (msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT) == 0)
+#endif
                        _exit(EXIT_FAILURE);
 
                if (errno != EACCES)
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to