From 44385c0baa98b0e27dad39cb8bd0e33ce5a027f6 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 30 Aug 2005 00:35:39 +0000 Subject: Move create_dirs() and create_file() into the textfile library --- hidd/sdp.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'hidd/sdp.c') diff --git a/hidd/sdp.c b/hidd/sdp.c index 05cacf45..ea76894b 100644 --- a/hidd/sdp.c +++ b/hidd/sdp.c @@ -77,7 +77,7 @@ static void epox_endian_quirk(unsigned char *data, int size) static int store_device_info(const bdaddr_t *src, const bdaddr_t *dst, struct hidp_connadd_req *req) { char filename[PATH_MAX + 1], addr[18], *str, *desc; - int i, fd, size; + int i, size; ba2str(src, addr); snprintf(filename, PATH_MAX, "%s/%s/hidd", STORAGEDIR, addr); @@ -102,11 +102,7 @@ static int store_device_info(const bdaddr_t *src, const bdaddr_t *dst, struct hi req->subclass, req->country, req->parser, desc, req->flags, req->name); - fd = open(filename, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); - if (fd < 0) - return -errno; - - close(fd); + create_file(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); ba2str(dst, addr); return textfile_put(filename, addr, str); -- cgit