summaryrefslogtreecommitdiffstats
path: root/loader/registry.c
diff options
context:
space:
mode:
authorszabii <szabii@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-03-21 00:14:42 +0000
committerszabii <szabii@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-03-21 00:14:42 +0000
commite0f650031fb81e30cc41a0702cdf63d86e894aa6 (patch)
treebcff45417464db3ee5ac2aefe53b380a0efd8275 /loader/registry.c
parent42e933e8d4573b2f53213a00504c0f2a8b031113 (diff)
downloadmpv-e0f650031fb81e30cc41a0702cdf63d86e894aa6.tar.bz2
mpv-e0f650031fb81e30cc41a0702cdf63d86e894aa6.tar.xz
get_path()
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@179 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'loader/registry.c')
-rw-r--r--loader/registry.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/loader/registry.c b/loader/registry.c
index 85699f56dd..3b90e98a2d 100644
--- a/loader/registry.c
+++ b/loader/registry.c
@@ -38,6 +38,8 @@ static reg_handle_t* head=0;
#define DIR -25
+extern char *get_path(char *);
+
static void create_registry();
static void open_registry();
static void save_registry();
@@ -68,17 +70,18 @@ static void open_registry()
int fd;
int i;
int len;
- struct passwd* pwent;
+// struct passwd* pwent;
char* pathname;
if(regs)
{
printf("Multiple open_registry(>\n");
return;
}
- pwent=getpwuid(getuid());
- pathname=(char*)malloc(strlen(pwent->pw_dir)+20);
- strcpy(pathname, pwent->pw_dir);
- strcat(pathname, "/.mplayer/registry");
+// pwent=getpwuid(getuid());
+// pathname=(char*)malloc(strlen(pwent->pw_dir)+20);
+// strcpy(pathname, pwent->pw_dir);
+// strcat(pathname, "/.mplayer/registry");
+ pathname = get_path("registry");
fd=open(pathname, O_RDONLY);
free(pathname);
if(fd==-1)
@@ -120,12 +123,13 @@ error:
static void save_registry()
{
int fd, i, len;
- struct passwd* pwent;
+// struct passwd* pwent;
char* pathname;
- pwent=getpwuid(getuid());
- pathname=(char*)malloc(strlen(pwent->pw_dir)+20);
- strcpy(pathname, pwent->pw_dir);
- strcat(pathname, "/.mplayer/registry");
+// pwent=getpwuid(getuid());
+// pathname=(char*)malloc(strlen(pwent->pw_dir)+20);
+// strcpy(pathname, pwent->pw_dir);
+// strcat(pathname, "/.mplayer/registry");
+ pathname = get_path("registry");
fd=open(pathname, O_WRONLY | O_CREAT, 00777);
free(pathname);
if(fd==-1)