diff options
author | Matthew Jordan <mjordan@digium.com> | 2015-03-30 02:29:39 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2015-03-30 02:29:39 +0000 |
commit | 61577cbee684c764b75322c2e4b7ff6741c9482c (patch) | |
tree | 4065d5e79c7c359e657218892f1206033ea6d769 /main | |
parent | 072734692e1ede359a7348ab81f9918d337f0c11 (diff) |
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
........
Merged revisions 433744 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433745 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r-- | main/stdtime/localtime.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/main/stdtime/localtime.c b/main/stdtime/localtime.c index 2cd5003d1..4b005207e 100644 --- a/main/stdtime/localtime.c +++ b/main/stdtime/localtime.c @@ -377,7 +377,7 @@ static void *inotify_daemon(void *data) 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; |