sysv_msg.c (13255) | sysv_msg.c (17971) |
---|---|
1/* $Id: sysv_msg.c,v 1.11 1995/12/15 05:00:27 peter Exp $ */ | 1/* $Id: sysv_msg.c,v 1.12 1996/01/05 16:37:56 wollman Exp $ */ |
2 3/* 4 * Implementation of SVID messages 5 * 6 * Author: Daniel Boulet 7 * 8 * Copyright 1993 Daniel Boulet and RTMX Inc. 9 * --- 637 unchanged lines hidden (view full) --- 647#ifdef MSG_DEBUG_OK 648 printf("error %d copying the message type\n", eval); 649#endif 650 msg_freehdr(msghdr); 651 msqptr->msg_perm.mode &= ~MSG_LOCKED; 652 wakeup((caddr_t)msqptr); 653 return(eval); 654 } | 2 3/* 4 * Implementation of SVID messages 5 * 6 * Author: Daniel Boulet 7 * 8 * Copyright 1993 Daniel Boulet and RTMX Inc. 9 * --- 637 unchanged lines hidden (view full) --- 647#ifdef MSG_DEBUG_OK 648 printf("error %d copying the message type\n", eval); 649#endif 650 msg_freehdr(msghdr); 651 msqptr->msg_perm.mode &= ~MSG_LOCKED; 652 wakeup((caddr_t)msqptr); 653 return(eval); 654 } |
655 user_msgp += sizeof(msghdr->msg_type); | 655 user_msgp = (char *)user_msgp + sizeof(msghdr->msg_type); |
656 657 /* 658 * Validate the message type 659 */ 660 661 if (msghdr->msg_type < 1) { 662 msg_freehdr(msghdr); 663 msqptr->msg_perm.mode &= ~MSG_LOCKED; --- 25 unchanged lines hidden (view full) --- 689 printf("error %d copying in message segment\n", eval); 690#endif 691 msg_freehdr(msghdr); 692 msqptr->msg_perm.mode &= ~MSG_LOCKED; 693 wakeup((caddr_t)msqptr); 694 return(eval); 695 } 696 msgsz -= tlen; | 656 657 /* 658 * Validate the message type 659 */ 660 661 if (msghdr->msg_type < 1) { 662 msg_freehdr(msghdr); 663 msqptr->msg_perm.mode &= ~MSG_LOCKED; --- 25 unchanged lines hidden (view full) --- 689 printf("error %d copying in message segment\n", eval); 690#endif 691 msg_freehdr(msghdr); 692 msqptr->msg_perm.mode &= ~MSG_LOCKED; 693 wakeup((caddr_t)msqptr); 694 return(eval); 695 } 696 msgsz -= tlen; |
697 user_msgp += tlen; | 697 user_msgp = (char *)user_msgp + tlen; |
698 next = msgmaps[next].next; 699 } 700 if (next != -1) 701 panic("didn't use all the msg segments"); 702 703 /* 704 * We've got the message. Unlock the msqid_ds. 705 */ --- 279 unchanged lines hidden (view full) --- 985 if (eval != 0) { 986#ifdef MSG_DEBUG_OK 987 printf("error (%d) copying out message type\n", eval); 988#endif 989 msg_freehdr(msghdr); 990 wakeup((caddr_t)msqptr); 991 return(eval); 992 } | 698 next = msgmaps[next].next; 699 } 700 if (next != -1) 701 panic("didn't use all the msg segments"); 702 703 /* 704 * We've got the message. Unlock the msqid_ds. 705 */ --- 279 unchanged lines hidden (view full) --- 985 if (eval != 0) { 986#ifdef MSG_DEBUG_OK 987 printf("error (%d) copying out message type\n", eval); 988#endif 989 msg_freehdr(msghdr); 990 wakeup((caddr_t)msqptr); 991 return(eval); 992 } |
993 user_msgp += sizeof(msghdr->msg_type); | 993 user_msgp = (char *)user_msgp + sizeof(msghdr->msg_type); |
994 995 /* 996 * Return the segments to the user 997 */ 998 999 next = msghdr->msg_spot; 1000 for (len = 0; len < msgsz; len += msginfo.msgssz) { 1001 size_t tlen; --- 12 unchanged lines hidden (view full) --- 1014#ifdef MSG_DEBUG_OK 1015 printf("error (%d) copying out message segment\n", 1016 eval); 1017#endif 1018 msg_freehdr(msghdr); 1019 wakeup((caddr_t)msqptr); 1020 return(eval); 1021 } | 994 995 /* 996 * Return the segments to the user 997 */ 998 999 next = msghdr->msg_spot; 1000 for (len = 0; len < msgsz; len += msginfo.msgssz) { 1001 size_t tlen; --- 12 unchanged lines hidden (view full) --- 1014#ifdef MSG_DEBUG_OK 1015 printf("error (%d) copying out message segment\n", 1016 eval); 1017#endif 1018 msg_freehdr(msghdr); 1019 wakeup((caddr_t)msqptr); 1020 return(eval); 1021 } |
1022 user_msgp += tlen; | 1022 user_msgp = (char *)user_msgp + tlen; |
1023 next = msgmaps[next].next; 1024 } 1025 1026 /* 1027 * Done, return the actual number of bytes copied out. 1028 */ 1029 1030 msg_freehdr(msghdr); 1031 wakeup((caddr_t)msqptr); 1032 *retval = msgsz; 1033 return(0); 1034} | 1023 next = msgmaps[next].next; 1024 } 1025 1026 /* 1027 * Done, return the actual number of bytes copied out. 1028 */ 1029 1030 msg_freehdr(msghdr); 1031 wakeup((caddr_t)msqptr); 1032 *retval = msgsz; 1033 return(0); 1034} |