diff options
author | dos-reis <gdr@axiomatics.org> | 2013-04-01 00:00:11 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2013-04-01 00:00:11 +0000 |
commit | 664e27a1d8f4927285e8c4f89870796c9d9f518e (patch) | |
tree | 0d898301aa9fe690bc9d02e9450b39492efb4d6c /src/lib/openpty.c | |
parent | 37a3397a82d94da8df1c0a0e48a39d43d17cce00 (diff) | |
download | open-axiom-664e27a1d8f4927285e8c4f89870796c9d9f518e.tar.gz |
Fix various warnings from the C++ compiler
Diffstat (limited to 'src/lib/openpty.c')
-rw-r--r-- | src/lib/openpty.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/src/lib/openpty.c b/src/lib/openpty.c index f737802a..5918aa7a 100644 --- a/src/lib/openpty.c +++ b/src/lib/openpty.c @@ -1,7 +1,7 @@ /* Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. All rights reserved. - Copyright (C) 2007-2009, Gabriel Dos Reis. + Copyright (C) 2007-2013, Gabriel Dos Reis. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -60,7 +60,24 @@ #include "openpty.h" -static void makeNextPtyNames(char * , char * ); +#if defined(SUNplatform) +static void +makeNextPtyNames(char *cont,char * serv) +{ + static int channelNo = 0; + static char group[] = "pqrstuvwxyzPQRST"; + static int groupNo = 0; + + sprintf(cont, "/dev/pty%c%x", group[groupNo], channelNo); + sprintf(serv, "/dev/tty%c%x", group[groupNo], channelNo); + channelNo++; /* try next */ + if (channelNo == 16) { /* move to new group */ + channelNo = 0; + groupNo++; + if (groupNo == 16) groupNo = 0; /* recycle */ + } +} +#endif /* @@ -149,21 +166,3 @@ extern char* ptsname(int); } -static void -makeNextPtyNames(char *cont,char * serv) -{ -#if defined(SUNplatform) - static int channelNo = 0; - static char group[] = "pqrstuvwxyzPQRST"; - static int groupNo = 0; - - sprintf(cont, "/dev/pty%c%x", group[groupNo], channelNo); - sprintf(serv, "/dev/tty%c%x", group[groupNo], channelNo); - channelNo++; /* try next */ - if (channelNo == 16) { /* move to new group */ - channelNo = 0; - groupNo++; - if (groupNo == 16) groupNo = 0; /* recycle */ - } -#endif -} |