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/shard/bug-shard-zerofill.c | |
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/shard/bug-shard-zerofill.c')
-rw-r--r-- | tests/bugs/shard/bug-shard-zerofill.c | 101 |
1 files changed, 51 insertions, 50 deletions
diff --git a/tests/bugs/shard/bug-shard-zerofill.c b/tests/bugs/shard/bug-shard-zerofill.c index c0525a58afc..ed4c8c54dc2 100644 --- a/tests/bugs/shard/bug-shard-zerofill.c +++ b/tests/bugs/shard/bug-shard-zerofill.c @@ -3,57 +3,58 @@ #include <glusterfs/api/glfs-handles.h> int -main (int argc, char *argv[]) +main(int argc, char *argv[]) { - glfs_t *fs = NULL; - glfs_fd_t *fd = NULL; - int ret = 1; - - if (argc != 5) { - fprintf (stderr, "Syntax: %s <host> <volname> <file-path> <log-file>\n", argv[0]); - return 1; - } - - fs = glfs_new (argv[2]); - if (!fs) { - fprintf (stderr, "glfs_new: returned NULL\n"); - return 1; - } - - ret = glfs_set_volfile_server (fs, "tcp", argv[1], 24007); - if (ret != 0) { - fprintf (stderr, "glfs_set_volfile_server: returned %d\n", ret); - goto out; - } - ret = glfs_set_logging (fs, argv[4], 7); - if (ret != 0) { - fprintf (stderr, "glfs_set_logging: returned %d\n", ret); - goto out; - } - ret = glfs_init (fs); - if (ret != 0) { - fprintf (stderr, "glfs_init: returned %d\n", ret); - goto out; - } - - fd = glfs_open (fs, argv[3], O_RDWR); - if (fd == NULL) { - fprintf (stderr, "glfs_open: returned NULL\n"); - goto out; - } - - /* Zero-fill "foo" with 10MB of data */ - ret = glfs_zerofill (fd, 0, 10485760); - if (ret <= 0) { - fprintf (stderr, "glfs_zerofill: returned %d\n", ret); - goto out; - } - - ret = 0; + glfs_t *fs = NULL; + glfs_fd_t *fd = NULL; + int ret = 1; + + if (argc != 5) { + fprintf(stderr, "Syntax: %s <host> <volname> <file-path> <log-file>\n", + argv[0]); + return 1; + } + + fs = glfs_new(argv[2]); + if (!fs) { + fprintf(stderr, "glfs_new: returned NULL\n"); + return 1; + } + + ret = glfs_set_volfile_server(fs, "tcp", argv[1], 24007); + if (ret != 0) { + fprintf(stderr, "glfs_set_volfile_server: returned %d\n", ret); + goto out; + } + ret = glfs_set_logging(fs, argv[4], 7); + if (ret != 0) { + fprintf(stderr, "glfs_set_logging: returned %d\n", ret); + goto out; + } + ret = glfs_init(fs); + if (ret != 0) { + fprintf(stderr, "glfs_init: returned %d\n", ret); + goto out; + } + + fd = glfs_open(fs, argv[3], O_RDWR); + if (fd == NULL) { + fprintf(stderr, "glfs_open: returned NULL\n"); + goto out; + } + + /* Zero-fill "foo" with 10MB of data */ + ret = glfs_zerofill(fd, 0, 10485760); + if (ret <= 0) { + fprintf(stderr, "glfs_zerofill: returned %d\n", ret); + goto out; + } + + ret = 0; out: - if (fd) - glfs_close(fd); - glfs_fini (fs); - return ret; + if (fd) + glfs_close(fd); + glfs_fini(fs); + return ret; } |