Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/testsuite/winsup.api/ltp/fcntl07B.c')
-rw-r--r--winsup/testsuite/winsup.api/ltp/fcntl07B.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/winsup/testsuite/winsup.api/ltp/fcntl07B.c b/winsup/testsuite/winsup.api/ltp/fcntl07B.c
index 51b88c278..405bf6127 100644
--- a/winsup/testsuite/winsup.api/ltp/fcntl07B.c
+++ b/winsup/testsuite/winsup.api/ltp/fcntl07B.c
@@ -134,8 +134,6 @@
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
-#include <stdlib.h>
#include <fcntl.h>
#include <sys/wait.h>
#include <limits.h>
@@ -145,10 +143,10 @@
#include "search_path.h"
void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
void help();
-char *TCID="fcntl07B"; /* Test program identifier. */
+const char *TCID="fcntl07B"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
@@ -168,11 +166,11 @@ int stat_loc; /* for waitpid() */
int npipe_fd;
/* file descriptors for a named pipe */
#define DEFAULT_FILE "DefaultFileName"
-char *File1 = DEFAULT_FILE;
+const char *File1 = DEFAULT_FILE;
#define DEFAULT_SUBPROG "test_open"
-char *openck = DEFAULT_SUBPROG; /* support program name to check for open FD */
-char subprog_path[_POSIX_PATH_MAX]; /* path to exec "openck" with */
+const char *openck = DEFAULT_SUBPROG; /* support program name to check for open FD */
+const char subprog_path[_POSIX_PATH_MAX];/* path to exec "openck" with */
#define STRSIZE 255
#define FIFONAME "FiFo"
@@ -180,12 +178,12 @@ int *testfds[] = {
&npipe_fd, 0
};
-char *testfdtypes[] = {
+const char *testfdtypes[] = {
"named pipe"
};
int test_open(char *arg);
-int do_exec(char *prog, int fd, char *tcd);
+int do_exec(const char *prog, int fd, const char *tcd);
int
main(int ac, char **av)
@@ -195,7 +193,7 @@ main(int ac, char **av)
int exec_return; /* return from do_exec */
int **tcp; /* testcase pointer (pointer to FD) */
- char **tcd; /* testcase description pointer */
+ const char **tcd; /* testcase description pointer */
/***************************************************************
* parse standard options, and exit if there is an error
@@ -356,7 +354,7 @@ help()
*/
int
-do_exec(char *prog, int fd, char *tcd)
+do_exec(const char *prog, int fd, const char *tcd)
{
int pid;
char pidname[STRSIZE];
@@ -403,9 +401,6 @@ test_open(char *arg)
int fd, rc;
int status;
- extern char *optarg;
- extern int optind;
-
fd = atoi(arg);
rc = fcntl(fd, F_GETFD, &status);