[Dsctl-devel] SF.net SVN: dsctl: [123] src/main.c
Status: Alpha
Brought to you by:
roger-linux
From: <rog...@us...> - 2007-07-18 00:06:11
|
Revision: 123 http://dsctl.svn.sourceforge.net/dsctl/?rev=123&view=rev Author: roger-linux Date: 2007-07-17 17:06:06 -0700 (Tue, 17 Jul 2007) Log Message: ----------- main.c: Check for existing ~/.dsctl file, if it exists, remove it. (I tried moving this puppy to the new ~/.dsctl/config, but this incurred too much code, for the amount of config info currently within the configuration file. So, just make users edit the two simple lines as we probably won't be moving config files for a long time again.) Signed-off-by: Roger <ro...@es...> Acked-by: Roger <ro...@es...> Modified Paths: -------------- src/main.c Modified: src/main.c =================================================================== --- src/main.c 2007-07-17 23:29:16 UTC (rev 122) +++ src/main.c 2007-07-18 00:06:06 UTC (rev 123) @@ -66,7 +66,7 @@ char configline[81]; char errorstr[100]; - + memset(serial_port, 0, 20); memset(configline, 0, 81); memset(errorstr, 0, 100); @@ -80,7 +80,10 @@ /* Check for $HOME/.dsctl folder */ configfolder_name = strcat(getenv("HOME"), "/.dsctl"); if ((configfolder = opendir(configfolder_name)) == NULL) + mkdir(configfolder_name, 0755); + if (errno == EEXIST) { + unlink(configfolder_name); mkdir(configfolder_name, 0755); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |