Project

General

Profile

api_bugs_darktable-2.4.1.patch

patch of the potential API bugs - Zhouyang Jia, 02/28/2018 04:31 PM

Download (2.62 KB)

View differences:

src/common/film.c
283 283
  char *last = &film->dirname[strlen(film->dirname) - 1];
284 284
  if(*last == '/' && last != film->dirname) *last = '\0'; // remove the closing /, unless it's also the start
285 285
  film->dir = g_dir_open(film->dirname, 0, NULL);
286
  if(!film->dir)
287
  {
288
    fprintf(stderr, "Failed to read dir %s: %s\n", film->dir, strerror(errno));
289
    return 0;
290
  }
291

  
286 292
  dt_control_add_job(darktable.control, DT_JOB_QUEUE_USER_BG, dt_film_import1_create(film));
287 293

  
288 294
  return filmid;
src/external/rawspeed/src/librawspeed/common/RawImage.cpp
568 568
void RawImageWorker::startThread()
569 569
{
570 570
  /* Initialize and set thread detached attribute */
571
  pthread_create(&threadid, &attr, RawImageWorkerThread, this);
571
  if(pthread_create(&threadid, &attr, RawImageWorkerThread, this) != 0)
572
    fprintf(stderr, "Can not create thread: %s!\n", strerror(errno));
572 573
}
573 574

  
574 575
void RawImageWorker::waitForThread()
src/imageio/storage/picasa.c
505 505
  curl_easy_setopt(ctx->curl_ctx, CURLOPT_WRITEFUNCTION, _picasa_api_buffer_write_func);
506 506
  curl_easy_setopt(ctx->curl_ctx, CURLOPT_WRITEDATA, &buffer);
507 507

  
508
  curl_easy_perform(ctx->curl_ctx);
508
  CURLcode res;
509
  res = curl_easy_perform(ctx->curl_ctx);
510
  if (res != CURLE_OK)
511
    fprintf(stderr, "curl_easy_perfom failed: %s\n", curl_easy_strerror(res));
509 512

  
510 513
  curl_slist_free_all(headers);
511 514

  
......
607 610
      curl_easy_setopt(ctx->curl_ctx, CURLOPT_READFUNCTION, _picasa_api_buffer_read_func);
608 611
      curl_easy_setopt(ctx->curl_ctx, CURLOPT_WRITEFUNCTION, _picasa_api_buffer_write_func);
609 612
      curl_easy_setopt(ctx->curl_ctx, CURLOPT_WRITEDATA, &response);
610
      curl_easy_perform(ctx->curl_ctx);
613
      res = curl_easy_perform(ctx->curl_ctx);
614
      if (res != CURLE_OK)
615
        fprintf(stderr, "curl_easy_perfom failed: %s\n", curl_easy_strerror(res));
611 616

  
612 617
#ifdef picasa_EXTRA_VERBOSE
613 618
      printf("Uploading: %s\n", response.data);