diff options
author | Gluster Ant <bugzilla-bot@gluster.org> | 2018-09-12 17:52:45 +0530 |
---|---|---|
committer | Nigel Babu <nigelb@redhat.com> | 2018-09-12 17:52:45 +0530 |
commit | e16868dede6455cab644805af6fe1ac312775e13 (patch) | |
tree | 15aebdb4fff2d87cf8a72f836816b3aa634da58d /tests/bugs/cli | |
parent | 45a71c0548b6fd2c757aa2e7b7671a1411948894 (diff) |
Land part 2 of clang-format changes
Change-Id: Ia84cc24c8924e6d22d02ac15f611c10e26db99b4
Signed-off-by: Nigel Babu <nigelb@redhat.com>
Diffstat (limited to 'tests/bugs/cli')
-rw-r--r-- | tests/bugs/cli/bug-1169302.c | 127 |
1 files changed, 64 insertions, 63 deletions
diff --git a/tests/bugs/cli/bug-1169302.c b/tests/bugs/cli/bug-1169302.c index aa9f950abf2..7c6b5fbf856 100644 --- a/tests/bugs/cli/bug-1169302.c +++ b/tests/bugs/cli/bug-1169302.c @@ -7,72 +7,73 @@ int keep_running = 1; -void stop_running(int sig) +void +stop_running(int sig) { - if (sig == SIGTERM) - keep_running = 0; + if (sig == SIGTERM) + keep_running = 0; } int -main (int argc, char *argv[]) +main(int argc, char *argv[]) { - glfs_t *fs = NULL; - int ret = 0; - glfs_fd_t *fd = NULL; - char *filename = NULL; - char *logfile = NULL; - char *host = NULL; - - if (argc != 5) { - return -1; - } - - host = argv[2]; - logfile = argv[3]; - filename = argv[4]; - - /* setup signal handler for exiting */ - signal (SIGTERM, stop_running); - - fs = glfs_new (argv[1]); - if (!fs) { - return -1; - } - - ret = glfs_set_volfile_server (fs, "tcp", host, 24007); - if (ret < 0) { - return -1; - } - - ret = glfs_set_logging (fs, logfile, 7); - if (ret < 0) { - return -1; - } - - ret = glfs_init (fs); - if (ret < 0) { - return -1; - } - - fd = glfs_creat (fs, filename, O_RDWR, 0644); - if (!fd) { - return -1; - } - - /* sleep until SIGTERM has been received */ - while (keep_running) { - sleep (1); - } - - ret = glfs_close (fd); - if (ret < 0) { - return -1; - } - - ret = glfs_fini (fs); - if (ret < 0) { - return -1; - } - - return 0; + glfs_t *fs = NULL; + int ret = 0; + glfs_fd_t *fd = NULL; + char *filename = NULL; + char *logfile = NULL; + char *host = NULL; + + if (argc != 5) { + return -1; + } + + host = argv[2]; + logfile = argv[3]; + filename = argv[4]; + + /* setup signal handler for exiting */ + signal(SIGTERM, stop_running); + + fs = glfs_new(argv[1]); + if (!fs) { + return -1; + } + + ret = glfs_set_volfile_server(fs, "tcp", host, 24007); + if (ret < 0) { + return -1; + } + + ret = glfs_set_logging(fs, logfile, 7); + if (ret < 0) { + return -1; + } + + ret = glfs_init(fs); + if (ret < 0) { + return -1; + } + + fd = glfs_creat(fs, filename, O_RDWR, 0644); + if (!fd) { + return -1; + } + + /* sleep until SIGTERM has been received */ + while (keep_running) { + sleep(1); + } + + ret = glfs_close(fd); + if (ret < 0) { + return -1; + } + + ret = glfs_fini(fs); + if (ret < 0) { + return -1; + } + + return 0; } |