aboutsummaryrefslogtreecommitdiffstats
path: root/src/tvtimeconf.c
diff options
context:
space:
mode:
authorvektor <devnull@localhost>2003-10-28 16:43:17 +0000
committervektor <devnull@localhost>2003-10-28 16:43:17 +0000
commit630512a7ab964d442cee83da23ee4315646e2bc2 (patch)
tree90b92171224509fc1db08396ef2d7af61b1dcfb5 /src/tvtimeconf.c
parent92704c045c049a32cde0cd4e4de88749ebf32022 (diff)
28 Oct 2003 Billy Biggs <vektor@dumbterm.net>
* tvtime/src/utils.h: Simplified the API for the fifo filename, added a function for creating directories nicely. * tvtime/src/utils.c: Implementation, ripped out Simon's nice but verbose fifo directory/name code. * tvtime/src/tvtime.c: Use the new API for the fifo location. * tvtime/src/tvtimeconf.c: Use the new API for creating directories. * tvtime/src/tvtime-command.c: Lots of error message cleanups, and use the new API for the fifo location. * tvtime/src/fifo.h: Removed the API to get the fifo filename, it was pointless and added yet another error case. The fifo object does not need to keep its own copy of the filename. * tvtime/src/fifo.c: Bye-bye.
Diffstat (limited to 'src/tvtimeconf.c')
-rw-r--r--src/tvtimeconf.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/tvtimeconf.c b/src/tvtimeconf.c
index 75a3b3d..0910185 100644
--- a/src/tvtimeconf.c
+++ b/src/tvtimeconf.c
@@ -919,28 +919,7 @@ config_t *config_new( void )
/* FIXME: Clean up ?? */
return 0;
}
-
- if( mkdir( temp_dirname, S_IRWXU ) < 0 ) {
- if( errno != EEXIST ) {
- lfprintf( stderr, _("Cannot create %s: %s.\n"),
- temp_dirname, strerror( errno ) );
- } else {
- DIR *temp_dir = opendir( temp_dirname );
- if( !temp_dir ) {
- lfprintf( stderr, _("%s is not a directory.\n"),
- temp_dirname );
- } else {
- closedir( temp_dir );
- }
- }
- /* If the directory already exists, we didn't need to create it. */
- } else {
- /* We created the directory, now force it to be owned by the user. */
- if( chown( temp_dirname, getuid(), getgid() ) < 0 ) {
- lfprintf( stderr, _("Cannot change owner of %s: %s.\n"),
- temp_dirname, strerror( errno ) );
- }
- }
+ mkdir_and_force_owner( temp_dirname, ct->uid, getgid() );
free( temp_dirname );
/* First read in global settings. */

Privacy Policy