]> mj.ucw.cz Git - libucw.git/commitdiff
UCW: Adapted to use ucw_thread_id()
authorMartin Mares <mj@ucw.cz>
Thu, 22 Jul 2010 13:34:46 +0000 (15:34 +0200)
committerMartin Mares <mj@ucw.cz>
Thu, 22 Jul 2010 13:34:46 +0000 (15:34 +0200)
ucw/tempfile.c

index f8b0294b9e85b8c4b19f9d6574d9cd10f5fb7892..76d9cd388d99fe3933bf7bfff404fc3b968ca30a 100644 (file)
@@ -61,10 +61,10 @@ temp_file_name(char *name_buf, int *open_flags)
       struct ucwlib_context *ctx = ucwlib_thread_context();
       int cnt = ++ctx->temp_counter;
       int pid = getpid();
-      if (ctx->thread_id == pid)
+      if (ucwlib_thread_id(ctx) == pid)
        len = snprintf(name_buf, TEMP_FILE_NAME_LEN, "%s/%s%d-%d", dir, temp_prefix, pid, cnt);
       else
-       len = snprintf(name_buf, TEMP_FILE_NAME_LEN, "%s/%s%d-%d-%d", dir, temp_prefix, pid, ctx->thread_id, cnt);
+       len = snprintf(name_buf, TEMP_FILE_NAME_LEN, "%s/%s%d-%d-%d", dir, temp_prefix, pid, ucwlib_thread_id(ctx), cnt);
       if (open_flags)
        *open_flags = 0;
     }