Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 184071
Collapse All | Expand All

(-)nvclock0.7.orig/src/backend/backend.c (-3 / +9 lines)
Lines 282-293 void set_card(int number) Link Here
282
void set_default_speeds(int num)
282
void set_default_speeds(int num)
283
{
283
{
284
    int i, eof;
284
    int i, eof;
285
    char buffer[100];
285
    char buffer[100], fname[1024], *home;
286
    volatile unsigned int *PEXTDEV;
286
    volatile unsigned int *PEXTDEV;
287
    volatile unsigned int *PRAMDAC;
287
    volatile unsigned int *PRAMDAC;
288
    FILE *fp;
288
    FILE *fp;
289
289
290
    if((fp = fopen("/tmp/nvclock", "r")) != NULL)
290
    if ((home = getenv("HOME")) == NULL)
291
        return;
292
293
    if (snprintf(fname, sizeof(fname), "%s/.nvclock", home) == -1)
294
        return;
295
296
    if((fp = fopen(fname, "r")) != NULL)
291
    {
297
    {
292
	/* Read the file .. */
298
	/* Read the file .. */
293
        for(eof = fscanf(fp, "%s",&buffer); eof != EOF; eof = fscanf(fp, "%s", &buffer))
299
        for(eof = fscanf(fp, "%s",&buffer); eof != EOF; eof = fscanf(fp, "%s", &buffer))
Lines 312-318 void set_default_speeds(int num) Link Here
312
    else
318
    else
313
    {
319
    {
314
	/* Write the config file */
320
	/* Write the config file */
315
    	fp = fopen("/tmp/nvclock", "w+");
321
    	fp = fopen(fname, "w+");
316
	fprintf(fp, "#This file is used by nvclock to be able to restore the card's speeds\n#Do not edit this file!\n");
322
	fprintf(fp, "#This file is used by nvclock to be able to restore the card's speeds\n#Do not edit this file!\n");
317
    
323
    
318
	for(i = 0; i <= num; i++)
324
	for(i = 0; i <= num; i++)

Return to bug 184071