~ubuntu-branches/ubuntu/precise/corosync/precise-proposed

« back to all changes in this revision

Viewing changes to test/testcpgzc.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Loschwitz
  • Date: 2011-10-19 14:32:18 UTC
  • mfrom: (1.1.6 upstream) (5.1.16 sid)
  • Revision ID: james.westby@ubuntu.com-20111019143218-ew8phl0raqyog844
Tags: 1.4.2-1
* Changed my email address in debian/control
* Add corosync-blackbox to the corosync package
* Imported Upstream version 1.4.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
#include <corosync/corotypes.h>
50
50
#include <corosync/cpg.h>
51
51
 
 
52
#define BUFFER_SIZE     8192
 
53
#define DEFAULT_GROUP_NAME      "GROUP"
 
54
 
52
55
static int quit = 0;
53
56
static int show_ip = 0;
54
57
 
181
184
                group_name.length = strlen(argv[optind])+1;
182
185
        }
183
186
        else {
184
 
                strcpy(group_name.value, "GROUP");
185
 
                group_name.length = 6;
 
187
                strcpy(group_name.value, DEFAULT_GROUP_NAME);
 
188
                group_name.length = strlen(DEFAULT_GROUP_NAME) + 1;
186
189
        }
187
190
 
188
191
        result = cpg_initialize (&handle, &callbacks);
190
193
                printf ("Could not initialize Cluster Process Group API instance error %d\n", result);
191
194
                exit (1);
192
195
        }
193
 
        cpg_zcb_alloc (handle, 8192, &buffer);
 
196
        cpg_zcb_alloc (handle, BUFFER_SIZE, &buffer);
194
197
        cpg_zcb_free (handle, buffer);
195
 
        cpg_zcb_alloc (handle, 8192, &buffer);
 
198
        cpg_zcb_alloc (handle, BUFFER_SIZE, &buffer);
196
199
 
197
200
        result = cpg_local_get (handle, &nodeid);
198
201
        if (result != CS_OK) {
218
221
                        perror ("select\n");
219
222
                }
220
223
                if (FD_ISSET (STDIN_FILENO, &read_fds)) {
221
 
                        fgets_res = fgets(buffer, sizeof(buffer), stdin);
 
224
                        fgets_res = fgets(buffer, BUFFER_SIZE, stdin);
222
225
                        if (fgets_res == NULL) {
223
226
                                cpg_leave(handle, &group_name);
224
227
                        }