View | Details | Raw Unified | Return to bug 19313
Collapse All | Expand All

(-)a/wireless-tools/ifrename.c (+17 lines)
Lines 2045-2050 mapping_readfile(const char * filename) Link Here
2045
  size_t		linelen = 0; 
2045
  size_t		linelen = 0; 
2046
  int			linenum = 0; 
2046
  int			linenum = 0; 
2047
  struct add_extra	extrainfo;
2047
  struct add_extra	extrainfo;
2048
  int			config_fd;
2048
2049
2049
  /* Reset the list of filters */
2050
  /* Reset the list of filters */
2050
  bzero(selector_active, sizeof(selector_active));
2051
  bzero(selector_active, sizeof(selector_active));
Lines 2066-2071 mapping_readfile(const char * filename) Link Here
2066
		  filename, strerror(errno)); 
2067
		  filename, strerror(errno)); 
2067
	  return(-1);
2068
	  return(-1);
2068
	}
2069
	}
2070
2071
      /* Open the config file for locking */
2072
      if ((config_fd = open(filename, O_RDONLY)) == -1)
2073
        {
2074
	  fprintf(stderr, "Error: Can't open configuration file `%s': %s\n",
2075
		  filename, strerror(errno));
2076
	  return(-1);
2077
        }
2078
2079
      /* Lock config file */
2080
      if (flock(config_fd, LOCK_EX) == -1)
2081
        {
2082
          fprintf(stderr, "Error: Can't lock configuration file `%s': %s\n",
2083
		  filename, strerror(errno));
2084
	  return(-1);
2085
        }
2069
    }
2086
    }
2070
2087
2071
  /* Read each line of file
2088
  /* Read each line of file

Return to bug 19313