Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4110173

(hpi) sysAvailable on Win32 has a code path that returns without a return stmt

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.1.6, 1.2.0
    • hotspot
    • x86, sparc
    • solaris_2.5.1, windows_95

      src/win32/javavm/runtime/sys_api_md.c

      Should return FALSE if fstat fails, or perhaps nonseek available, in case
      fstat returns error for a pipe (as it does on OS/2).

      This error could have been detected by compiling
      with compilation warning for functions not returning a value
      when declared to do so.

      int
      sysAvailable(int fd, long *pbytes) {
          long cur, end;
          struct stat stbuf;

          if (fstat(fd, &stbuf) >= 0) {
             .
             .
             .
          }
      #if defined OS2 /*ibm*/
          return FALSE; /* This would be better */
          return nonSeekAvailable(fd, pbytes); /* or this */
      #endif /*ibm*/
      }

            apalanissunw Anand Palaniswamy (Inactive)
            miflemi Mick Fleming
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: