PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LCOV - code coverage report
Current view: top level - ext/sysvmsg - sysvmsg.c (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 165 174 94.8 %
Date: 2014-04-10 Functions: 10 10 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :   +----------------------------------------------------------------------+
       3             :   | PHP Version 5                                                        |
       4             :   +----------------------------------------------------------------------+
       5             :   | Copyright (c) 1997-2014 The PHP Group                                |
       6             :   +----------------------------------------------------------------------+
       7             :   | This source file is subject to version 3.01 of the PHP license,      |
       8             :   | that is bundled with this package in the file LICENSE, and is        |
       9             :   | available through the world-wide-web at the following url:           |
      10             :   | http://www.php.net/license/3_01.txt                                  |
      11             :   | If you did not receive a copy of the PHP license and are unable to   |
      12             :   | obtain it through the world-wide-web, please send a note to          |
      13             :   | license@php.net so we can mail you a copy immediately.               |
      14             :   +----------------------------------------------------------------------+
      15             :   | Author: Wez Furlong <wez@thebrainroom.com>                           |
      16             :   +----------------------------------------------------------------------+
      17             : */
      18             : 
      19             : /* $Id: adf1d2d6be849c46eed3c3ee6f1cbebd1448d6e5 $ */
      20             : 
      21             : #ifdef HAVE_CONFIG_H
      22             : #include "config.h"
      23             : #endif
      24             : 
      25             : #include "php.h"
      26             : #include "php_globals.h"
      27             : #include "ext/standard/info.h"
      28             : #include "php_sysvmsg.h"
      29             : #include "ext/standard/php_var.h"
      30             : #include "ext/standard/php_smart_str.h"
      31             : 
      32             : /* In order to detect MSG_EXCEPT use at run time; we have no way
      33             :  * of knowing what the bit definitions are, so we can't just define
      34             :  * out own MSG_EXCEPT value. */
      35             : #define PHP_MSG_IPC_NOWAIT      1
      36             : #define PHP_MSG_NOERROR         2
      37             : #define PHP_MSG_EXCEPT          4
      38             : 
      39             : /* True global resources - no need for thread safety here */
      40             : static int le_sysvmsg;
      41             : 
      42             : /* {{{ arginfo */
      43             : ZEND_BEGIN_ARG_INFO_EX(arginfo_msg_get_queue, 0, 0, 1)
      44             :         ZEND_ARG_INFO(0, key)
      45             :         ZEND_ARG_INFO(0, perms)
      46             : ZEND_END_ARG_INFO()
      47             : 
      48             : ZEND_BEGIN_ARG_INFO_EX(arginfo_msg_send, 0, 0, 3)
      49             :         ZEND_ARG_INFO(0, queue)
      50             :         ZEND_ARG_INFO(0, msgtype)
      51             :         ZEND_ARG_INFO(0, message)
      52             :         ZEND_ARG_INFO(0, serialize)
      53             :         ZEND_ARG_INFO(0, blocking)
      54             :         ZEND_ARG_INFO(1, errorcode)
      55             : ZEND_END_ARG_INFO()
      56             : 
      57             : ZEND_BEGIN_ARG_INFO_EX(arginfo_msg_receive, 0, 0, 5)
      58             :         ZEND_ARG_INFO(0, queue)
      59             :         ZEND_ARG_INFO(0, desiredmsgtype)
      60             :         ZEND_ARG_INFO(1, msgtype)
      61             :         ZEND_ARG_INFO(0, maxsize)
      62             :         ZEND_ARG_INFO(1, message)
      63             :         ZEND_ARG_INFO(0, unserialize)
      64             :         ZEND_ARG_INFO(0, flags)
      65             :         ZEND_ARG_INFO(1, errorcode)
      66             : ZEND_END_ARG_INFO()
      67             : 
      68             : ZEND_BEGIN_ARG_INFO_EX(arginfo_msg_remove_queue, 0, 0, 1)
      69             :         ZEND_ARG_INFO(0, queue)
      70             : ZEND_END_ARG_INFO()
      71             : 
      72             : ZEND_BEGIN_ARG_INFO_EX(arginfo_msg_stat_queue, 0, 0, 1)
      73             :         ZEND_ARG_INFO(0, queue)
      74             : ZEND_END_ARG_INFO()
      75             : 
      76             : ZEND_BEGIN_ARG_INFO_EX(arginfo_msg_set_queue, 0, 0, 2)
      77             :         ZEND_ARG_INFO(0, queue)
      78             :         ZEND_ARG_INFO(0, data)
      79             : ZEND_END_ARG_INFO()
      80             : 
      81             : ZEND_BEGIN_ARG_INFO_EX(arginfo_msg_queue_exists, 0, 0, 1)
      82             :         ZEND_ARG_INFO(0, key)
      83             : ZEND_END_ARG_INFO()
      84             : /* }}} */
      85             : 
      86             : /* {{{ sysvmsg_functions[]
      87             :  *
      88             :  * Every user visible function must have an entry in sysvmsg_functions[].
      89             :  */
      90             : const zend_function_entry sysvmsg_functions[] = {
      91             :         PHP_FE(msg_get_queue,                           arginfo_msg_get_queue)
      92             :         PHP_FE(msg_send,                                        arginfo_msg_send)
      93             :         PHP_FE(msg_receive,                                     arginfo_msg_receive)
      94             :         PHP_FE(msg_remove_queue,                        arginfo_msg_remove_queue)
      95             :         PHP_FE(msg_stat_queue,                          arginfo_msg_stat_queue)
      96             :         PHP_FE(msg_set_queue,                           arginfo_msg_set_queue)
      97             :         PHP_FE(msg_queue_exists,                        arginfo_msg_queue_exists)
      98             :         PHP_FE_END
      99             : };
     100             : /* }}} */
     101             : 
     102             : /* {{{ sysvmsg_module_entry
     103             :  */
     104             : zend_module_entry sysvmsg_module_entry = {
     105             :         STANDARD_MODULE_HEADER,
     106             :         "sysvmsg",
     107             :         sysvmsg_functions,
     108             :         PHP_MINIT(sysvmsg),
     109             :         NULL,
     110             :         NULL,
     111             :         NULL,
     112             :         PHP_MINFO(sysvmsg),
     113             :         NO_VERSION_YET,
     114             :         STANDARD_MODULE_PROPERTIES
     115             : };
     116             : /* }}} */
     117             : 
     118             : #ifdef COMPILE_DL_SYSVMSG
     119             : ZEND_GET_MODULE(sysvmsg)
     120             : #endif
     121             : 
     122           7 : static void sysvmsg_release(zend_rsrc_list_entry *rsrc TSRMLS_DC)
     123             : {
     124           7 :         sysvmsg_queue_t * mq = (sysvmsg_queue_t *) rsrc->ptr;
     125           7 :         efree(mq);
     126           7 : }
     127             : 
     128             : /* {{{ PHP_MINIT_FUNCTION
     129             :  */
     130       20105 : PHP_MINIT_FUNCTION(sysvmsg)
     131             : {
     132       20105 :         le_sysvmsg = zend_register_list_destructors_ex(sysvmsg_release, NULL, "sysvmsg queue", module_number);
     133       20105 :         REGISTER_LONG_CONSTANT("MSG_IPC_NOWAIT", PHP_MSG_IPC_NOWAIT, CONST_PERSISTENT|CONST_CS);
     134       20105 :         REGISTER_LONG_CONSTANT("MSG_EAGAIN",   EAGAIN,             CONST_PERSISTENT|CONST_CS);
     135       20105 :         REGISTER_LONG_CONSTANT("MSG_ENOMSG",   ENOMSG,             CONST_PERSISTENT|CONST_CS);
     136       20105 :         REGISTER_LONG_CONSTANT("MSG_NOERROR",    PHP_MSG_NOERROR,    CONST_PERSISTENT|CONST_CS);
     137       20105 :         REGISTER_LONG_CONSTANT("MSG_EXCEPT",     PHP_MSG_EXCEPT,     CONST_PERSISTENT|CONST_CS);
     138       20105 :         return SUCCESS;
     139             : }
     140             : /* }}} */
     141             : 
     142             : /* {{{ PHP_MINFO_FUNCTION
     143             :  */
     144         148 : PHP_MINFO_FUNCTION(sysvmsg)
     145             : {
     146         148 :         php_info_print_table_start();
     147         148 :         php_info_print_table_row(2, "sysvmsg support", "enabled");
     148         148 :         php_info_print_table_row(2, "Revision", "$Id: adf1d2d6be849c46eed3c3ee6f1cbebd1448d6e5 $");
     149         148 :         php_info_print_table_end();
     150         148 : }
     151             : /* }}} */
     152             : 
     153             : /* {{{ proto bool msg_set_queue(resource queue, array data)
     154             :    Set information for a message queue */
     155           6 : PHP_FUNCTION(msg_set_queue)
     156             : {
     157             :         zval *queue, *data;
     158           6 :         sysvmsg_queue_t *mq = NULL;
     159             :         struct msqid_ds stat;
     160             : 
     161           6 :         RETVAL_FALSE;
     162             : 
     163           6 :         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &queue, &data) == FAILURE) {
     164           1 :                 return;
     165             :         }
     166             : 
     167           5 :         ZEND_FETCH_RESOURCE(mq, sysvmsg_queue_t *, &queue, -1, "sysvmsg queue", le_sysvmsg);
     168             : 
     169           5 :         if (msgctl(mq->id, IPC_STAT, &stat) == 0) {
     170             :                 zval **item;
     171             : 
     172             :                 /* now pull out members of data and set them in the stat buffer */
     173           4 :                 if (zend_hash_find(Z_ARRVAL_P(data), "msg_perm.uid", sizeof("msg_perm.uid"), (void **) &item) == SUCCESS) {
     174           1 :                         convert_to_long_ex(item);
     175           1 :                         stat.msg_perm.uid = Z_LVAL_PP(item);
     176             :                 }
     177           4 :                 if (zend_hash_find(Z_ARRVAL_P(data), "msg_perm.gid", sizeof("msg_perm.gid"), (void **) &item) == SUCCESS) {
     178           1 :                         convert_to_long_ex(item);
     179           1 :                         stat.msg_perm.gid = Z_LVAL_PP(item);
     180             :                 }
     181           4 :                 if (zend_hash_find(Z_ARRVAL_P(data), "msg_perm.mode", sizeof("msg_perm.mode"), (void **) &item) == SUCCESS) {
     182           1 :                         convert_to_long_ex(item);
     183           1 :                         stat.msg_perm.mode = Z_LVAL_PP(item);
     184             :                 }
     185           4 :                 if (zend_hash_find(Z_ARRVAL_P(data), "msg_qbytes", sizeof("msg_qbytes"), (void **) &item) == SUCCESS) {
     186           1 :                         convert_to_long_ex(item);
     187           1 :                         stat.msg_qbytes = Z_LVAL_PP(item);
     188             :                 }
     189           4 :                 if (msgctl(mq->id, IPC_SET, &stat) == 0) {
     190           4 :                         RETVAL_TRUE;
     191             :                 }
     192             :         }
     193             : }
     194             : /* }}} */
     195             : 
     196             : /* {{{ proto array msg_stat_queue(resource queue)
     197             :    Returns information about a message queue */
     198           7 : PHP_FUNCTION(msg_stat_queue)
     199             : {
     200             :         zval *queue;
     201           7 :         sysvmsg_queue_t *mq = NULL;
     202             :         struct msqid_ds stat;
     203             : 
     204           7 :         RETVAL_FALSE;
     205             : 
     206           7 :         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &queue) == FAILURE) {
     207           1 :                 return;
     208             :         }
     209             : 
     210           6 :         ZEND_FETCH_RESOURCE(mq, sysvmsg_queue_t *, &queue, -1, "sysvmsg queue", le_sysvmsg);
     211             : 
     212           6 :         if (msgctl(mq->id, IPC_STAT, &stat) == 0) {
     213           5 :                 array_init(return_value);
     214             : 
     215           5 :                 add_assoc_long(return_value, "msg_perm.uid", stat.msg_perm.uid);
     216           5 :                 add_assoc_long(return_value, "msg_perm.gid", stat.msg_perm.gid);
     217           5 :                 add_assoc_long(return_value, "msg_perm.mode", stat.msg_perm.mode);
     218           5 :                 add_assoc_long(return_value, "msg_stime",  stat.msg_stime);
     219           5 :                 add_assoc_long(return_value, "msg_rtime",  stat.msg_rtime);
     220           5 :                 add_assoc_long(return_value, "msg_ctime",  stat.msg_ctime);
     221           5 :                 add_assoc_long(return_value, "msg_qnum",   stat.msg_qnum);
     222           5 :                 add_assoc_long(return_value, "msg_qbytes", stat.msg_qbytes);
     223           5 :                 add_assoc_long(return_value, "msg_lspid",  stat.msg_lspid);
     224           5 :                 add_assoc_long(return_value, "msg_lrpid",  stat.msg_lrpid);
     225             :         }
     226             : }
     227             : /* }}} */
     228             : 
     229             : 
     230             : /* {{{ proto bool msg_queue_exists(int key)
     231             :    Check whether a message queue exists */
     232           4 : PHP_FUNCTION(msg_queue_exists)
     233             : {
     234             :         long key;
     235             : 
     236           4 :         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &key) == FAILURE)       {
     237           0 :                 return;
     238             :         }
     239             : 
     240           4 :         if (msgget(key, 0) < 0) {
     241           3 :                 RETURN_FALSE;
     242             :         }
     243             : 
     244           1 :         RETURN_TRUE;
     245             : }
     246             : /* }}} */
     247             : 
     248             : 
     249             : /* {{{ proto resource msg_get_queue(int key [, int perms])
     250             :    Attach to a message queue */
     251           7 : PHP_FUNCTION(msg_get_queue)
     252             : {
     253             :         long key;
     254           7 :         long perms = 0666;
     255             :         sysvmsg_queue_t *mq;
     256             : 
     257           7 :         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &key, &perms) == FAILURE) {
     258           0 :                 return;
     259             :         }
     260             : 
     261           7 :         mq = (sysvmsg_queue_t *) emalloc(sizeof(sysvmsg_queue_t));
     262             : 
     263           7 :         mq->key = key;
     264           7 :         mq->id = msgget(key, 0);
     265           7 :         if (mq->id < 0)   {
     266             :                 /* doesn't already exist; create it */
     267           7 :                 mq->id = msgget(key, IPC_CREAT | IPC_EXCL | perms);
     268           7 :                 if (mq->id < 0)   {
     269           0 :                         php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
     270           0 :                         efree(mq);
     271           0 :                         RETURN_FALSE;
     272             :                 }
     273             :         }
     274           7 :         RETVAL_RESOURCE(zend_list_insert(mq, le_sysvmsg TSRMLS_CC));
     275             : }
     276             : /* }}} */
     277             : 
     278             : /* {{{ proto bool msg_remove_queue(resource queue)
     279             :    Destroy the queue */
     280           7 : PHP_FUNCTION(msg_remove_queue)
     281             : {
     282             :         zval *queue;
     283           7 :         sysvmsg_queue_t *mq = NULL;
     284             : 
     285           7 :         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &queue) == FAILURE) {
     286           0 :                 return;
     287             :         }
     288             : 
     289           7 :         ZEND_FETCH_RESOURCE(mq, sysvmsg_queue_t *, &queue, -1, "sysvmsg queue", le_sysvmsg);
     290             : 
     291           7 :         if (msgctl(mq->id, IPC_RMID, NULL) == 0) {
     292           7 :                 RETVAL_TRUE;
     293             :         } else {
     294           0 :                 RETVAL_FALSE;
     295             :         }
     296             : }
     297             : /* }}} */
     298             : 
     299             : /* {{{ proto mixed msg_receive(resource queue, int desiredmsgtype, int &msgtype, int maxsize, mixed message [, bool unserialize=true [, int flags=0 [, int errorcode]]])
     300             :    Send a message of type msgtype (must be > 0) to a message queue */
     301          13 : PHP_FUNCTION(msg_receive)
     302             : {
     303          13 :         zval *out_message, *queue, *out_msgtype, *zerrcode = NULL;
     304          13 :         long desiredmsgtype, maxsize, flags = 0;
     305          13 :         long realflags = 0;
     306          13 :         zend_bool do_unserialize = 1;
     307          13 :         sysvmsg_queue_t *mq = NULL;
     308          13 :         struct php_msgbuf *messagebuffer = NULL; /* buffer to transmit */
     309             :         int result;
     310             : 
     311          13 :         RETVAL_FALSE;
     312             : 
     313          13 :         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlzlz|blz",
     314             :                                 &queue, &desiredmsgtype, &out_msgtype, &maxsize,
     315             :                                 &out_message, &do_unserialize, &flags, &zerrcode) == FAILURE) {
     316           2 :                 return;
     317             :         }
     318             : 
     319          11 :         if (maxsize <= 0) {
     320           1 :                 php_error_docref(NULL TSRMLS_CC, E_WARNING, "maximum size of the message has to be greater than zero");
     321           1 :                 return;
     322             :         }
     323             : 
     324          10 :         if (flags != 0) {
     325           7 :                 if (flags & PHP_MSG_EXCEPT) {
     326             : #ifndef MSG_EXCEPT
     327             :                         php_error_docref(NULL TSRMLS_CC, E_WARNING, "MSG_EXCEPT is not supported on your system");
     328             :                         RETURN_FALSE;
     329             : #else
     330           0 :                         realflags |= MSG_EXCEPT;
     331             : #endif
     332             :                 }
     333           7 :                 if (flags & PHP_MSG_NOERROR) {
     334           0 :                         realflags |= MSG_NOERROR;
     335             :                 }
     336           7 :                 if (flags & PHP_MSG_IPC_NOWAIT) {
     337           7 :                         realflags |= IPC_NOWAIT;
     338             :                 }
     339             :         }
     340             : 
     341          10 :         ZEND_FETCH_RESOURCE(mq, sysvmsg_queue_t *, &queue, -1, "sysvmsg queue", le_sysvmsg);
     342             : 
     343          10 :         messagebuffer = (struct php_msgbuf *) safe_emalloc(maxsize, 1, sizeof(struct php_msgbuf));
     344             : 
     345          10 :         result = msgrcv(mq->id, messagebuffer, maxsize, desiredmsgtype, realflags);
     346             : 
     347          10 :         zval_dtor(out_msgtype);
     348          10 :         zval_dtor(out_message);
     349          10 :         ZVAL_LONG(out_msgtype, 0);
     350          10 :         ZVAL_FALSE(out_message);
     351             : 
     352          10 :         if (zerrcode) {
     353           2 :                 zval_dtor(zerrcode);
     354           2 :                 ZVAL_LONG(zerrcode, 0);
     355             :         }
     356             : 
     357          10 :         if (result >= 0) {
     358             :                 /* got it! */
     359           7 :                 ZVAL_LONG(out_msgtype, messagebuffer->mtype);
     360             : 
     361           7 :                 RETVAL_TRUE;
     362           7 :                 if (do_unserialize)     {
     363             :                         php_unserialize_data_t var_hash;
     364           2 :                         zval *tmp = NULL;
     365           2 :                         const unsigned char *p = (const unsigned char *) messagebuffer->mtext;
     366             : 
     367           2 :                         MAKE_STD_ZVAL(tmp);
     368           2 :                         PHP_VAR_UNSERIALIZE_INIT(var_hash);
     369           2 :                         if (!php_var_unserialize(&tmp, &p, p + result, &var_hash TSRMLS_CC)) {
     370           1 :                                 php_error_docref(NULL TSRMLS_CC, E_WARNING, "message corrupted");
     371           1 :                                 RETVAL_FALSE;
     372             :                         } else {
     373           7 :                                 REPLACE_ZVAL_VALUE(&out_message, tmp, 0);
     374             :                         }
     375           2 :                         FREE_ZVAL(tmp);
     376           2 :                         PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
     377             :                 } else {
     378           5 :                         ZVAL_STRINGL(out_message, messagebuffer->mtext, result, 1);
     379             :                 }
     380           3 :         } else if (zerrcode) {
     381           1 :                 ZVAL_LONG(zerrcode, errno);
     382             :         }
     383          10 :         efree(messagebuffer);
     384             : }
     385             : /* }}} */
     386             : 
     387             : /* {{{ proto bool msg_send(resource queue, int msgtype, mixed message [, bool serialize=true [, bool blocking=true [, int errorcode]]])
     388             :    Send a message of type msgtype (must be > 0) to a message queue */
     389          11 : PHP_FUNCTION(msg_send)
     390             : {
     391          11 :         zval *message, *queue, *zerror=NULL;
     392             :         long msgtype;
     393          11 :         zend_bool do_serialize = 1, blocking = 1;
     394          11 :         sysvmsg_queue_t * mq = NULL;
     395          11 :         struct php_msgbuf * messagebuffer = NULL; /* buffer to transmit */
     396             :         int result;
     397          11 :         int message_len = 0;
     398             : 
     399          11 :         RETVAL_FALSE;
     400             : 
     401          11 :         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz|bbz",
     402             :                                 &queue, &msgtype, &message, &do_serialize, &blocking, &zerror) == FAILURE) {
     403           1 :                 return;
     404             :         }
     405             : 
     406          10 :         ZEND_FETCH_RESOURCE(mq, sysvmsg_queue_t*, &queue, -1, "sysvmsg queue", le_sysvmsg);
     407             : 
     408          10 :         if (do_serialize) {
     409           2 :                 smart_str msg_var = {0};
     410             :                 php_serialize_data_t var_hash;
     411             : 
     412           2 :                 PHP_VAR_SERIALIZE_INIT(var_hash);
     413           2 :                 php_var_serialize(&msg_var, &message, &var_hash TSRMLS_CC);
     414           2 :                 PHP_VAR_SERIALIZE_DESTROY(var_hash);
     415             : 
     416             :                 /* NB: php_msgbuf is 1 char bigger than a long, so there is no need to
     417             :                  * allocate the extra byte. */
     418           2 :                 messagebuffer = safe_emalloc(msg_var.len, 1, sizeof(struct php_msgbuf));
     419           2 :                 memcpy(messagebuffer->mtext, msg_var.c, msg_var.len + 1);
     420           2 :                 message_len = msg_var.len;
     421           2 :                 smart_str_free(&msg_var);
     422             :         } else {
     423             :                 char *p;
     424           8 :                 switch (Z_TYPE_P(message)) {
     425             :                         case IS_STRING:
     426           2 :                                 p = Z_STRVAL_P(message);
     427           2 :                                 message_len = Z_STRLEN_P(message);
     428           2 :                                 break;
     429             : 
     430             :                         case IS_LONG:
     431             :                         case IS_BOOL:
     432           2 :                                 message_len = spprintf(&p, 0, "%ld", Z_LVAL_P(message));
     433           2 :                                 break;
     434             : 
     435             :                         case IS_DOUBLE:
     436           2 :                                 message_len = spprintf(&p, 0, "%F", Z_DVAL_P(message));
     437           2 :                                 break;
     438             : 
     439             :                         default:
     440           2 :                                 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Message parameter must be either a string or a number.");
     441           2 :                                 RETURN_FALSE;
     442             :                 }
     443             : 
     444           6 :                 messagebuffer = safe_emalloc(message_len, 1, sizeof(struct php_msgbuf));
     445           6 :                 memcpy(messagebuffer->mtext, p, message_len + 1);
     446             : 
     447           6 :                 if (Z_TYPE_P(message) != IS_STRING) {
     448           4 :                         efree(p);
     449             :                 }
     450             :         }
     451             : 
     452             :         /* set the message type */
     453           8 :         messagebuffer->mtype = msgtype;
     454             : 
     455           8 :         result = msgsnd(mq->id, messagebuffer, message_len, blocking ? 0 : IPC_NOWAIT);
     456             : 
     457           8 :         efree(messagebuffer);
     458             : 
     459           8 :         if (result == -1) {
     460           1 :                 php_error_docref(NULL TSRMLS_CC, E_WARNING, "msgsnd failed: %s", strerror(errno));
     461           1 :                 if (zerror) {
     462           1 :                         ZVAL_LONG(zerror, errno);
     463             :                 }
     464             :         } else {
     465           7 :                 RETVAL_TRUE;
     466             :         }
     467             : }
     468             : /* }}} */
     469             : 
     470             : /*
     471             :  * Local variables:
     472             :  * tab-width: 4
     473             :  * c-basic-offset: 4
     474             :  * End:
     475             :  * vim600: noet sw=4 ts=4 tw=78 fdm=marker
     476             :  * vim<600: noet sw=4 ts=4 tw=78
     477             :  */

Generated by: LCOV version 1.10

Generated at Thu, 10 Apr 2014 08:54:00 +0000 (8 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.