From 1b6a97c9c0d245c9690359fee112908b4a8fbf2c Mon Sep 17 00:00:00 2001 From: Jacob Adams Date: Sun, 1 Feb 2015 23:04:30 -0500 Subject: [PATCH] commands/autopart: Fix dead code block Fix dead code block, make surrounding code more readable, and remove unused mode variable. closes #20 Change-Id: I802e3d8680d7a7adc7acd580bfcec9dc28af0bc4 --- minix/commands/autopart/autopart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/minix/commands/autopart/autopart.c b/minix/commands/autopart/autopart.c index 4a47c3ad2..d94eab463 100644 --- a/minix/commands/autopart/autopart.c +++ b/minix/commands/autopart/autopart.c @@ -1521,7 +1521,7 @@ void regionize(void) void m_read(int ev, int *biosdrive) /* Read the partition table from the current device. */ { - int i, mode, n, v; + int i, n, v; struct part_entry *pe; u32_t system_hz; @@ -1531,8 +1531,8 @@ void m_read(int ev, int *biosdrive) stat_start(0); fflush(stdout); - if ((device= open(curdev->name, mode= O_RDWR, 0666)) < 0) { - if (device >= 0) { close(device); device= -1; } + device = open(curdev->name, O_RDWR, 0666); + if (device < 0) { return; } -- 2.44.0