-
-
usr/src/cmd/iconv/Makefile (Diff revision 1) It might be nice to include Makefile.ctf and build this with ctf support to make debugging easier.
-
-
-
-
usr/src/cmd/iconv/charmap.c (Diff revision 1) Maybe we should use abort instead of assert(0) to make sure that in the case someone ever turns off asserts, it still blows up?
-
usr/src/cmd/iconv/charmap.c (Diff revision 1) Since where isn't used anywhere in this function, it's allowed to be NULL, so you can optionally drop where.
-
usr/src/cmd/iconv/charmap.c (Diff revision 1) Can you add a comment about why it's safe to free ssym and esym here? That'll help folks who are going through understand this better.
At first glance, it's quite weird to see the thing that's not allocating it freeing it, though I suspect that's because we're integrating with yacc here.
-
usr/src/cmd/iconv/charmap.c (Diff revision 1) Probably worth a comment here indicating that it's designed to try and find a subset match. At first I was surprised to see the iteration around len.
-
usr/src/cmd/iconv/iconv.c (Diff revision 1) Is there a reason this is harcoded as opposed to doing something like basename(argv[0]) in main() right away?
-
usr/src/cmd/iconv/iconv.c (Diff revision 1) It seems worth including the sterror here that indicates why the iconv_open() failed, as otherwise it'll be hard for users to get a sense of what went wrong.
-
usr/src/cmd/iconv/iconv.c (Diff revision 1) I notice that you're using an off64_t, but I don't see anything that indicates that the rest of this is using 64-bit offset capable functions. Should this actually be being built with large file support? Has this been tested with files that need that off64_t?
-
usr/src/cmd/iconv/iconv.c (Diff revision 1) Can you add a comment regarding why it's safe to write this out before we check errno? It seems like we're relying on the downstream callers to never change oleft at all in error, which I'm not sure is guaranteed by iconv(3C), for example.
-
-
-
usr/src/cmd/iconv/iconv.c (Diff revision 1) I think we're guaranteed that this doesn't overlap, is that right? Otherwise, we may want to use memmove() to be safe.
-
-
-
-
usr/src/cmd/iconv/iconv.c (Diff revision 1) Isn't this meant to be iconv_errno? Couldn't errno have changed? due to other callers?
-
usr/src/cmd/iconv/iconv.c (Diff revision 1) What's the point of the perror here given the line above? Won't errno also have been potentially clobbered at this point through the fprintf, etc.?
-
usr/src/cmd/iconv/iconv.c (Diff revision 1) Why do we ignore the fwrite failures here? Shouldn't that be fatal like the ones earlier?
-
usr/src/cmd/iconv/iconv.c (Diff revision 1) While the script doesn't feel that appropriate (but it's what we have for now), the error handling is inappropriate. We need to at least indicate errors that happened. Otherwise this will silently fail and exit 0, causing users to think that there's nothing there!
-
-
usr/src/cmd/iconv/iconv_list.sh (Diff revision 1) General illumos scripting style has traditionally had the do statement on the line with the while/flor.
-
usr/src/cmd/iconv/iconv_list.sh (Diff revision 1) Looks like this whitespace isn't consistent with the rest.
-
usr/src/cmd/iconv/iconv_list.sh (Diff revision 1) General illumos scripting style has traditionally had the do statement on the line with the while/flor.
-
usr/src/cmd/iconv/iconv_list.sh (Diff revision 1) Looks like this whitespace isn't consistent with the rest.
-
usr/src/cmd/iconv/iconv_list.sh (Diff revision 1) General illumos scripting style has traditionally had the do statement on the line with the while/flor.
-
usr/src/cmd/iconv/scanner.c (Diff revision 1) Do we need to be checking for strdup failure here or is that being done elsewhere? If the latter, can the comment indicate where it's actually checked?
-
usr/src/cmd/iconv/scanner.c (Diff revision 1) It appears that warnings is only ever set? Was it supposed to be used as part of determining some part of the exit status?
-
usr/src/pkg/manifests/system-test-utiltest.mf (Diff revision 1) For this to work, do we need to depend on the packages that have the iconv modules that are being used in the tests?
-
The follow ups here all look pretty reasonable. Though there are still some outstanding questions in the back and forth that I'd like to make sure are straightened out before I sign off.
-
In general, this looks good. A couple minor questions on this, but should be able to wrap this up and integrate it. Thanks again for helping replace the closed bins!
-
usr/src/cmd/iconv/Makefile (Diff revisions 4 - 9) I think we also need the _LARGEFILE_SOURCE macro set here.
-
usr/src/cmd/iconv/iconv_list.c (Diff revision 9) Cast to void or handle for lint? Same with the other printf calls in this function.
-
usr/src/cmd/iconv/iconv_list.c (Diff revision 9) Is a 256 byte dirent large enough? Should we instead be using a constant? dirent.h(3HEAD) seems to refer to NAME_MAX, while head/dirent.h seems to have a MAXNAMELEN of 512? I guess it's unlikely to matter immediately.
-
usr/src/cmd/iconv/iconv_list.c (Diff revision 9) Should we worry about truncation or just case to void?
-
closed source iconv has better error message in case the supplied conversion is invalid:
altair:yuri:~$ echo привет | iconv -t utf64
Not supported UTF-8 to utf64
altair:yuri:~$ echo привет | ~/ws/il-iconv/proto/root_i386/usr/bin/iconv -t utf64
iconv_open failed: Invalid argument
altair:yuri:~$