<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    <br>
    <div class="moz-cite-prefix">On 16/2/8 下午7:11, Piotr Caban wrote:<br>
    </div>
    <blockquote cite="mid:56B877D9.8030507@gmail.com" type="cite">Hi, <br>
      <br>
      On 02/05/16 10:30, YongHao Hu wrote: <br>
      <blockquote type="cite">On 16/1/12 下午9:28, Piotr Caban wrote: <br>
        <blockquote type="cite">On 01/11/16 14:56, YongHao Hu wrote: <br>
          <blockquote type="cite">+    delete_flag = 1; <br>
            +    for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { <br>
            +        errno = 0xdeadbeef; <br>
            +        SetLastError(0xdeadbeef); <br>
            +        ret = p_tr2_sys__Symlink(tests[i].existing_path, <br>
            tests[i].new_path); <br>
            +        if(ret==ERROR_PRIVILEGE_NOT_HELD || <br>
            ret==ERROR_INVALID_FUNCTION) { <br>
            +            delete_flag = 0; <br>
            +            tests[i].last_error = ret; <br>
            +            win_skip("Privilege not held or symbolic link
            not <br>
            supported, skipping symbolic link tests.\n"); <br>
          </blockquote>
          I think it would be nicer if the tests are really skipped in
          this <br>
          case. Please detect such case and return from the function
          instead of <br>
          adding workarounds in the code for it. <br>
          <br>
        </blockquote>
        Could you explain a bit more details? <br>
      </blockquote>
      You're trying to create the symlinks in loop. Because of this if
      symbolic links are not supported you're printing this information
      many times. I think you should try to create one symlink and if it
      doesn't work just skip all of the tests. <br>
      <br>
    </blockquote>
    <br>
    Do you think adding a break in the loop after detecting such case is
    good?For example:<br>
    <br>
    <blockquote>    delete_flag = 1;<br>
          for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) {<br>
              errno = 0xdeadbeef;<br>
              SetLastError(0xdeadbeef);<br>
              ret = p_tr2_sys__Symlink(tests[i].existing_path,<br>
      tests[i].new_path);<br>
              if(ret==ERROR_PRIVILEGE_NOT_HELD ||<br>
      ret==ERROR_INVALID_FUNCTION) {<br>
                  delete_flag = 0;<br>
                  tests[i].last_error = ret;<br>
                  win_skip("Privilege not held or symbolic link not<br>
      supported, skipping symbolic link tests.\n"); <br>
      +              break;<br>
              }<br>
        }<br>
    </blockquote>
    <br>
    <br>
    Thank you.<br>
  </body>
</html>