Re: [Log4c-devel] Fix mmap error checking
Brought to you by:
valtri
From: František D. <va...@ci...> - 2016-01-30 22:25:09
|
Hello, fixed, thanks! Frantisek Michael McConville píše v So 30. 01. 2016 v 15:33 -0500: > mmap returns MAP_FAILED, not NULL, when it fails. The below patch > should > work. > > Thanks for your time, > Michael > > > diff --git a/src/log4c/appender_type_mmap.c > b/src/log4c/appender_type_mmap.c > index 6e907f3..6890ce0 100644 > --- a/src/log4c/appender_type_mmap.c > +++ b/src/log4c/appender_type_mmap.c > @@ -89,7 +89,7 @@ static int mmap_open(log4c_appender_t* this) > > minfo->addr = mmap(NULL, minfo->length, PROT_READ|PROT_WRITE, > MAP_SHARED, minfo->fd, 0); > - if (minfo->addr == NULL) { > + if (minfo->addr == MAP_FAILED) { > perror("mmap"); > mmap_info_delete(minfo); > return -1; > > ------------------------------------------------------------------- > ----------- > Site24x7 APM Insight: Get Deep Visibility into Application > Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 > _______________________________________________ > Log4c-devel mailing list > Log...@li... > https://lists.sourceforge.net/lists/listinfo/log4c-devel |