Author: mjordan Date: Sun Mar 29 21:29:10 2015 New Revision: 433744 URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=433744 Log: main/stdtime/localtime: Fix warning introduced in r433720
The patch in r433720 caused a warning to be kicked back by gcc. It occurred due to this check in unistd.h: if (__nbytes > __bos0 (__buf)) return __read_chk_warn (__fd, __buf, __nbytes, __bos0 (__buf)); That is, if __nbytes is greater than the result of GCC's built-in object size for the struct, we'll kick back a warning. As it turns out, this is because there is an error in the code in the patch. We are passing the address of the pointer to the struct, not iev, which is a pointer to the struct. Hence, the number of bytes is probably going to be lot larger than the number of bytes that make up a pointer! This patch changes the code just read from the pointer to the struct - which fixes the warning. ASTERISK-24917 ........ Merged revisions 433743 from http://svn.asterisk.org/svn/asterisk/branches/11 Modified: branches/13/ (props changed) branches/13/main/stdtime/localtime.c Propchange: branches/13/ ------------------------------------------------------------------------------ Binary property 'branch-11-merged' - no diff available. Modified: branches/13/main/stdtime/localtime.c URL: http://svnview.digium.com/svn/asterisk/branches/13/main/stdtime/localtime.c?view=diff&rev=433744&r1=433743&r2=433744 ============================================================================== --- branches/13/main/stdtime/localtime.c (original) +++ branches/13/main/stdtime/localtime.c Sun Mar 29 21:29:10 2015 @@ -377,7 +377,7 @@ for (;/*ever*/;) { /* This read should block, most of the time. */ - if ((res = read(inotify_fd, &iev, real_sizeof_iev)) < sizeof(*iev) && res > 0) { + if ((res = read(inotify_fd, iev, real_sizeof_iev)) < sizeof(*iev) && res > 0) { /* This should never happen */ ast_log(LOG_ERROR, "Inotify read less than a full event (%zd < %zu)?!!\n", res, sizeof(*iev)); break; -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- svn-commits mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/svn-commits