From: <ta...@us...> - 2008-04-25 05:34:08
|
Revision: 3946 http://gfarm.svn.sourceforge.net/gfarm/?rev=3946&view=rev Author: tatebe Date: 2008-04-24 22:33:19 -0700 (Thu, 24 Apr 2008) Log Message: ----------- fix warning about type casting do not display directory names Modified Paths: -------------- gfarm_v2/trunk/gftool/gfwhere/gfwhere.c Modified: gfarm_v2/trunk/gftool/gfwhere/gfwhere.c =================================================================== --- gfarm_v2/trunk/gftool/gfwhere/gfwhere.c 2008-04-25 05:16:13 UTC (rev 3945) +++ gfarm_v2/trunk/gftool/gfwhere/gfwhere.c 2008-04-25 05:33:19 UTC (rev 3946) @@ -52,7 +52,7 @@ { gfarm_error_t e = GFARM_ERR_NO_ERROR; gfarm_mode_t mode; - int do_not_display_name = (int)arg; + int do_not_display_name = *(int *)arg; if (!do_not_display_name) display_name(path, st, arg); @@ -137,17 +137,20 @@ for (i = 0; i < n; i++) { char *p = gfarm_stringlist_elem(&paths, i); struct gfs_stat st; + int do_not_display = 0; if ((e = gfs_stat(p, &st)) != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", p, gfarm_error_string(e)); } else { - if (GFARM_S_ISREG(st.st_mode)) + if (GFARM_S_ISREG(st.st_mode)) { + do_not_display = (n == 1); e = display_replica_catalog(p, &st, - (void *)(n == 1)); + &do_not_display); + } else if (opt_recursive) e = gfarm_foreach_directory_hierarchy( - display_replica_catalog, display_name, - NULL, p, 0); + display_replica_catalog, NULL, NULL, + p, &do_not_display); else fprintf(stderr, "%s: not a file\n", p); gfs_stat_free(&st); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |