From 646066a660927a70533387bd3f06d2f4e5201511 Mon Sep 17 00:00:00 2001 From: Forrest Zhao Date: Tue, 17 Feb 2009 11:39:12 +0800 Subject: [PATCH] obexd: set O_TRUNC when open a file --- obexd/src/obex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obexd/src/obex.c b/obexd/src/obex.c index 4dbd21cd4..6badc4776 100644 --- a/obexd/src/obex.c +++ b/obexd/src/obex.c @@ -522,7 +522,7 @@ gint os_prepare_put(struct obex_session *os) path = g_build_filename(os->current_folder, os->name, NULL); - os->fd = open(path, O_WRONLY | O_CREAT, 0600); + os->fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0600); if (os->fd < 0) { error("open(%s): %s (%d)", path, strerror(errno), errno); g_free(path); -- 2.47.3