losetup: use LOOP_foo defines

Signed-off-by: Lauri Kasanen <curaga@operamail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Lauri Kasanen 2010-07-04 00:04:03 +02:00 committed by Denys Vlasenko
parent 5c296de390
commit 7c1b2b5420
2 changed files with 8 additions and 8 deletions

View File

@ -1606,18 +1606,18 @@ extern const char bb_default_login_shell[];
# define VC_3 "/dev/vc/3" # define VC_3 "/dev/vc/3"
# define VC_4 "/dev/vc/4" # define VC_4 "/dev/vc/4"
# define VC_5 "/dev/vc/5" # define VC_5 "/dev/vc/5"
#if defined(__sh__) || defined(__H8300H__) || defined(__H8300S__) # if defined(__sh__) || defined(__H8300H__) || defined(__H8300S__)
/* Yes, this sucks, but both SH (including sh64) and H8 have a SCI(F) for their /* Yes, this sucks, but both SH (including sh64) and H8 have a SCI(F) for their
respective serial ports .. as such, we can't use the common device paths for respective serial ports .. as such, we can't use the common device paths for
these. -- PFM */ these. -- PFM */
# define SC_0 "/dev/ttsc/0" # define SC_0 "/dev/ttsc/0"
# define SC_1 "/dev/ttsc/1" # define SC_1 "/dev/ttsc/1"
# define SC_FORMAT "/dev/ttsc/%d" # define SC_FORMAT "/dev/ttsc/%d"
#else # else
# define SC_0 "/dev/tts/0" # define SC_0 "/dev/tts/0"
# define SC_1 "/dev/tts/1" # define SC_1 "/dev/tts/1"
# define SC_FORMAT "/dev/tts/%d" # define SC_FORMAT "/dev/tts/%d"
#endif # endif
# define VC_FORMAT "/dev/vc/%d" # define VC_FORMAT "/dev/vc/%d"
# define LOOP_FORMAT "/dev/loop/%d" # define LOOP_FORMAT "/dev/loop/%d"
# define LOOP_NAMESIZE (sizeof("/dev/loop/") + sizeof(int)*3 + 1) # define LOOP_NAMESIZE (sizeof("/dev/loop/") + sizeof(int)*3 + 1)
@ -1630,15 +1630,15 @@ extern const char bb_default_login_shell[];
# define VC_3 "/dev/tty3" # define VC_3 "/dev/tty3"
# define VC_4 "/dev/tty4" # define VC_4 "/dev/tty4"
# define VC_5 "/dev/tty5" # define VC_5 "/dev/tty5"
#if defined(__sh__) || defined(__H8300H__) || defined(__H8300S__) # if defined(__sh__) || defined(__H8300H__) || defined(__H8300S__)
# define SC_0 "/dev/ttySC0" # define SC_0 "/dev/ttySC0"
# define SC_1 "/dev/ttySC1" # define SC_1 "/dev/ttySC1"
# define SC_FORMAT "/dev/ttySC%d" # define SC_FORMAT "/dev/ttySC%d"
#else # else
# define SC_0 "/dev/ttyS0" # define SC_0 "/dev/ttyS0"
# define SC_1 "/dev/ttyS1" # define SC_1 "/dev/ttyS1"
# define SC_FORMAT "/dev/ttyS%d" # define SC_FORMAT "/dev/ttyS%d"
#endif # endif
# define VC_FORMAT "/dev/tty%d" # define VC_FORMAT "/dev/tty%d"
# define LOOP_FORMAT "/dev/loop%d" # define LOOP_FORMAT "/dev/loop%d"
# define LOOP_NAMESIZE (sizeof("/dev/loop") + sizeof(int)*3 + 1) # define LOOP_NAMESIZE (sizeof("/dev/loop") + sizeof(int)*3 + 1)

View File

@ -65,9 +65,9 @@ int losetup_main(int argc UNUSED_PARAM, char **argv)
n = 0; n = 0;
while (1) { while (1) {
char *s; char *s;
char dev[sizeof(LOOP_NAME) + sizeof(int)*3]; char dev[LOOP_NAMESIZE];
sprintf(dev, LOOP_NAME"%u", n); sprintf(dev, LOOP_FORMAT, n);
s = query_loop(dev); s = query_loop(dev);
n++; n++;
if (!s) { if (!s) {