From: Shane Bryan <shane.bryan@linux.intel.com>
To: ofono@ofono.org
Subject: Re: Compile error
Date: Tue, 04 Aug 2009 09:22:31 -0700 [thread overview]
Message-ID: <20090804092231.4e8c8677@cyclone> (raw)
In-Reply-To: <4A77C635.7020606@gmail.com>
[-- 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
next prev parent reply other threads:[~2009-08-04 16:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-04 5:25 Compile error Marko Saukko
2009-08-04 16:22 ` Shane Bryan [this message]
2009-08-04 20:20 ` Denis Kenzior
2009-08-04 20:57 ` Shane Bryan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090804092231.4e8c8677@cyclone \
--to=shane.bryan@linux.intel.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox