Mercurial > pidgin
changeset 21025:77a35a382a73
Add some checking to make sure the directory was created ok before saving
silc buddy info
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Sat, 27 Oct 2007 13:23:01 +0000 |
parents | 61a87e02da29 |
children | f9fd63586fcb |
files | libpurple/protocols/silc/buddy.c libpurple/protocols/silc10/buddy.c |
diffstat | 2 files changed, 10 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/silc/buddy.c Sat Oct 27 13:12:27 2007 +0000 +++ b/libpurple/protocols/silc/buddy.c Sat Oct 27 13:23:01 2007 +0000 @@ -934,8 +934,11 @@ /* Create dir if it doesn't exist */ if ((g_stat(filename, &st)) == -1) { if (errno == ENOENT) { - if (pw->pw_uid == geteuid()) - g_mkdir(filename, 0755); + if (pw->pw_uid == geteuid()) { + int ret = g_mkdir(filename, 0755); + if (ret < 0) + return; + } } }
--- a/libpurple/protocols/silc10/buddy.c Sat Oct 27 13:12:27 2007 +0000 +++ b/libpurple/protocols/silc10/buddy.c Sat Oct 27 13:23:01 2007 +0000 @@ -939,8 +939,11 @@ /* Create dir if it doesn't exist */ if ((g_stat(filename, &st)) == -1) { if (errno == ENOENT) { - if (pw->pw_uid == geteuid()) - g_mkdir(filename, 0755); + if (pw->pw_uid == geteuid()) { + int ret = g_mkdir(filename, 0755); + if (ret < 0) + return; + } } }