I also don't understand the point of want_directory. That was something pathscale added, but it seems like instead table.c should call is_directory.
-----Original Message----- From: David Coakley [mailto:dcoak...@gmail.com] Sent: Wednesday, December 29, 2010 6:43 PM To: Sun Chan Cc: open64-devel Subject: Re: [Open64-devel] patch for fixing bug introduce in revision 3437 I will not have a chance to look closely until next week, but I have a few minor complaints... we can always address these later if the bug is blocking progress. The comment for want_directory() is exactly the same as the comment for is_directory(). This looks like an error. Also, I think it is strange to have a boolean function that always returns TRUE. Maybe the code generated by table.c should change instead. -David Coakley / AMD Open Source Compiler Engineering On Wed, Dec 29, 2010 at 3:18 PM, Sun Chan <sun.c...@gmail.com> wrote: > go ahead. > Sun > > On Tue, Dec 28, 2010 at 11:31 PM, Wu Yongchong <wuyongch...@gmail.com> wrote: >> Hi, David >> >> Could you please help review this patch >> See https://bugs.open64.net/show_bug.cgi?id=709 >> >> In revision 3437 , the function want_directory has been remove >> considering it's a dead function, but it's not true. This function >> will always return TRUE no matter the path is a directory or not. >> If it's replace with is_directory, the following situation will fail . >> >> There is no directory named libs >> $ opencc -I ./libs test.c >> opencc WARNING: unknown flag: -I >> gcc: ./libs: No such file or directory >> >> >> Here is the patch. >> Index: osprey/driver/file_utils.c >> =================================================================== >> --- osprey/driver/file_utils.c (revision 3437) >> +++ osprey/driver/file_utils.c (working copy) >> @@ -163,6 +163,13 @@ >> return FALSE; >> } >> >> +boolean want_directory (char *path) >> +{ >> + if (is_directory(path) && fullwarn) >> + warning("%s is not a directory", path); >> + return TRUE; >> +} >> + >> /* check if directory is writable */ >> boolean >> directory_is_writable (char *path) >> Index: osprey/driver/file_utils.h >> =================================================================== >> --- osprey/driver/file_utils.h (revision 3437) >> +++ osprey/driver/file_utils.h (working copy) >> @@ -61,6 +61,9 @@ >> /* check whether is a directory */ >> extern boolean is_directory (char *path); >> >> +/* check whether is a directory */ >> +extern boolean want_directory (char *path); >> + >> /* check whether directory is writable */ >> extern boolean directory_is_writable (char *path); >> >> Index: osprey/driver/table.c >> =================================================================== >> --- osprey/driver/table.c (revision 3437) >> +++ osprey/driver/table.c (working copy) >> @@ -827,7 +827,7 @@ >> || options[i].syntax == >> needs_directory_or_null >> #endif >> ) { >> - fprintf(f, "\tif >> (is_directory(next_string(argv,argi))) {\n"); >> + fprintf(f, "\tif >> (want_directory(next_string(argv,argi))) {\n"); >> } >> fprintf(f, "\t\toptargs = get_optarg(argv, argi);\n"); >> if (options[i].syntax == needs_decimal) { >> >> >> -- >> yongchong >> >> ------------------------------------------------------------------------------ >> Learn how Oracle Real Application Clusters (RAC) One Node allows customers >> to consolidate database storage, standardize their database environment, and, >> should the need arise, upgrade to a full multi-node Oracle RAC database >> without downtime or disruption >> http://p.sf.net/sfu/oracle-sfdevnl >> _______________________________________________ >> Open64-devel mailing list >> Open64-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/open64-devel >> > ------------------------------------------------------------------------------ Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Open64-devel mailing list Open64-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open64-devel ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ----------------------------------------------------------------------------------- ------------------------------------------------------------------------------ Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Open64-devel mailing list Open64-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open64-devel