Browse Source

Use serial_close to pair with every serial_open

Luke Dashjr 12 years ago
parent
commit
310321936a
3 changed files with 3 additions and 3 deletions
  1. 1 1
      driver-bitforce.c
  2. 1 1
      driver-icarus.c
  3. 1 1
      driver-modminer.c

+ 1 - 1
driver-bitforce.c

@@ -144,7 +144,7 @@ void bitforce_cmd2(int fd, int procid, void *buf, size_t bufsz, const char *cmd,
 	BFgets(buf, bufsz, fd);
 	BFgets(buf, bufsz, fd);
 }
 }
 
 
-#define BFclose(fd) close(fd)
+#define BFclose(fd) serial_close(fd)
 
 
 struct bitforce_init_data {
 struct bitforce_init_data {
 	bool sc;
 	bool sc;

+ 1 - 1
driver-icarus.c

@@ -292,7 +292,7 @@ static int icarus_write(int fd, const void *buf, size_t bufLen)
 	return 0;
 	return 0;
 }
 }
 
 
-#define icarus_close(fd) close(fd)
+#define icarus_close(fd) serial_close(fd)
 
 
 static void do_icarus_close(struct thr_info *thr)
 static void do_icarus_close(struct thr_info *thr)
 {
 {

+ 1 - 1
driver-modminer.c

@@ -173,7 +173,7 @@ modminer_detect()
 static bool
 static bool
 modminer_reopen(struct cgpu_info*modminer)
 modminer_reopen(struct cgpu_info*modminer)
 {
 {
-	close(modminer->device->device_fd);
+	serial_close(modminer->device->device_fd);
 	int fd = serial_open(modminer->device_path, 0, 10, true);
 	int fd = serial_open(modminer->device_path, 0, 10, true);
 	if (unlikely(-1 == fd)) {
 	if (unlikely(-1 == fd)) {
 		applog(LOG_ERR, "%s: Failed to reopen %s", modminer->dev_repr, modminer->device_path);
 		applog(LOG_ERR, "%s: Failed to reopen %s", modminer->dev_repr, modminer->device_path);