* parse_T is a shitty function name for chvt()
* chvt() argument can be const
This commit is contained in:
10
misc.c
10
misc.c
@ -6,7 +6,7 @@
|
|||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.48 2007/01/18 20:48:23 tg Exp $\t"
|
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.49 2007/01/18 20:54:30 tg Exp $\t"
|
||||||
MKSH_SH_H_ID);
|
MKSH_SH_H_ID);
|
||||||
|
|
||||||
#undef USE_CHVT
|
#undef USE_CHVT
|
||||||
@ -25,7 +25,7 @@ static int do_gmatch(const unsigned char *, const unsigned char *,
|
|||||||
const unsigned char *, const unsigned char *);
|
const unsigned char *, const unsigned char *);
|
||||||
static const unsigned char *cclass(const unsigned char *, int);
|
static const unsigned char *cclass(const unsigned char *, int);
|
||||||
#ifdef USE_CHVT
|
#ifdef USE_CHVT
|
||||||
static void parse_T(char *);
|
static void chvt(const char *);
|
||||||
#endif
|
#endif
|
||||||
static char *do_phys_path(XString *, char *, const char *);
|
static char *do_phys_path(XString *, char *, const char *);
|
||||||
|
|
||||||
@ -368,7 +368,7 @@ parse_args(char **argv,
|
|||||||
errorf("no TIOCSCTTY ioctl");
|
errorf("no TIOCSCTTY ioctl");
|
||||||
#else
|
#else
|
||||||
change_flag(FTALKING, OF_CMDLINE, 1);
|
change_flag(FTALKING, OF_CMDLINE, 1);
|
||||||
parse_T(go.optarg);
|
chvt(go.optarg);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
@ -1318,7 +1318,7 @@ do_phys_path(XString *xsp, char *xp, const char *pathl)
|
|||||||
|
|
||||||
#ifdef USE_CHVT
|
#ifdef USE_CHVT
|
||||||
static void
|
static void
|
||||||
parse_T(char *fn)
|
chvt(const char *fn)
|
||||||
{
|
{
|
||||||
char dv[20];
|
char dv[20];
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
@ -1328,7 +1328,7 @@ parse_T(char *fn)
|
|||||||
memcpy(dv, "/dev/ttyC", 9);
|
memcpy(dv, "/dev/ttyC", 9);
|
||||||
strlcpy(dv + 9, fn, 20 - 9);
|
strlcpy(dv + 9, fn, 20 - 9);
|
||||||
if (stat(dv, &sb)) {
|
if (stat(dv, &sb)) {
|
||||||
memmove(dv + 8, dv + 9, 20 - 9);
|
strlcpy(dv + 8, fn, 20 - 8);
|
||||||
if (stat(dv, &sb))
|
if (stat(dv, &sb))
|
||||||
errorf("chvt: can't find tty %s", fn);
|
errorf("chvt: can't find tty %s", fn);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user