* Compile error @ 2009-08-04 5:25 Marko Saukko 2009-08-04 16:22 ` Shane Bryan 0 siblings, 1 reply; 4+ messages in thread From: Marko Saukko @ 2009-08-04 5:25 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 495 bytes --] Hi, I'm getting following error when compiling the latest git version with gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3. cc1: warnings being treated as errors sim.c: In function ‘sim_op_retrieve_cb’: sim.c:347: error: ignoring return value of ‘write’, declared with attribute warn_unused_result sim.c: In function ‘sim_op_info_cb’: sim.c:473: error: ignoring return value of ‘write’, declared with attribute warn_unused_result make[2]: *** [sim.o] Error 1 Regards, Marko ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Compile error 2009-08-04 5:25 Compile error Marko Saukko @ 2009-08-04 16:22 ` Shane Bryan 2009-08-04 20:20 ` Denis Kenzior 0 siblings, 1 reply; 4+ messages in thread From: Shane Bryan @ 2009-08-04 16:22 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 526 bytes --] On Tue, 04 Aug 2009 08:25:09 +0300 Marko Saukko <marko.saukko@gmail.com> wrote: > Hi, > > I'm getting following error when compiling the latest git version with > gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3. Attached is a patch to fix the errors. WARNING: It still does nothing with the return values, but it resolves the compiler errors, *that's it*. Someone who knows something about what should happen if the write fails really ought to review and adjust this as appropriate. I am not that person. Shane... [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-fix-ignored-return-size-when-calling-write.patch --] [-- Type: text/x-patch, Size: 1677 bytes --] >From 2adb1f998dc62b9987a0b8982d0e288969710891 Mon Sep 17 00:00:00 2001 From: Shane Bryan <shane.bryan@linux.intel.com> Date: Tue, 4 Aug 2009 09:13:31 -0700 Subject: [PATCH] fix ignored return size when calling write () sim.c uses write () but ignores the size returned. This causes compile failures with default options generated with bootstrap Signed-off-by: Shane Bryan <shane.bryan@linux.intel.com> --- src/sim.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sim.c b/src/sim.c index 6e144f4..1c0666e 100644 --- a/src/sim.c +++ b/src/sim.c @@ -312,6 +312,7 @@ static void sim_op_retrieve_cb(const struct ofono_error *error, char *imsi = sim->imsi; char *path; int fd; + ssize_t w_size; if (error->type != OFONO_ERROR_TYPE_NO_ERROR) { sim_op_error(modem); @@ -333,7 +334,7 @@ static void sim_op_retrieve_cb(const struct ofono_error *error, if (lseek(fd, (op->current - 1) * op->record_length + SIM_CACHE_HEADER_SIZE, SEEK_SET) != (off_t) -1) - write(fd, data, op->record_length); + w_size = write(fd, data, op->record_length); close(fd); } @@ -409,6 +410,7 @@ static void sim_op_info_cb(const struct ofono_error *error, int length, enum sim_file_access update; enum sim_file_access invalidate; enum sim_file_access rehabilitate; + ssize_t w_size; if (error->type != OFONO_ERROR_TYPE_NO_ERROR) { sim_op_error(modem); @@ -459,7 +461,7 @@ static void sim_op_info_cb(const struct ofono_error *error, int length, fileinfo[4] = record_length >> 8; fileinfo[5] = record_length & 0xff; - write(fd, fileinfo, 6); + w_size = write(fd, fileinfo, 6); close(fd); } } -- 1.6.0.4 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: Compile error 2009-08-04 16:22 ` Shane Bryan @ 2009-08-04 20:20 ` Denis Kenzior 2009-08-04 20:57 ` Shane Bryan 0 siblings, 1 reply; 4+ messages in thread From: Denis Kenzior @ 2009-08-04 20:20 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 391 bytes --] Hi, > On Tue, 04 Aug 2009 08:25:09 +0300 > > Marko Saukko <marko.saukko@gmail.com> wrote: > > Hi, > > > > I'm getting following error when compiling the latest git version with > > gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3. > > Attached is a patch to fix the errors. Andrew & myself have fixed this properly yesterday, the patch should now be pushed upstream. Regards, -Denis ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Compile error 2009-08-04 20:20 ` Denis Kenzior @ 2009-08-04 20:57 ` Shane Bryan 0 siblings, 0 replies; 4+ messages in thread From: Shane Bryan @ 2009-08-04 20:57 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 618 bytes --] On Tue, 4 Aug 2009 15:20:18 -0500 Denis Kenzior <denkenz@gmail.com> wrote: > Hi, > > > On Tue, 04 Aug 2009 08:25:09 +0300 > > > > Marko Saukko <marko.saukko@gmail.com> wrote: > > > Hi, > > > > > > I'm getting following error when compiling the latest git version > > > with gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3. > > > > Attached is a patch to fix the errors. > > Andrew & myself have fixed this properly yesterday, the patch should > now be pushed upstream. Heh, figures... I was too lazy to pull latest and check before I fired off my temp fix. Thanks for pushing a fix though! -- Shane... ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-08-04 20:57 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-08-04 5:25 Compile error Marko Saukko 2009-08-04 16:22 ` Shane Bryan 2009-08-04 20:20 ` Denis Kenzior 2009-08-04 20:57 ` Shane Bryan
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox